X10 Community Forum
🖥️ActiveHome Pro => SDK => Topic started by: marbobley on September 16, 2010, 12:07:59 PM
-
here is my code:
Dim $temp = ""
HotKeySet("{F11}","_exit")
$rcdll = DllOpen("ahscript.dll")
If @error Then
MsgBox(0,"error open dll",@error)
EndIf
Func _exit()
Exit
EndFunc
While 1
$temp = DllCall($rcdll,"str","RecvAction")
If @error Then
MsgBox(0,"error call recvaction",@error)
EndIf
If $temp = "" Then
Else
MsgBox(0,"",$temp)
EndIf
WEnd
when i call the dll i get error "3"
what am i doing wrong?
never did this dll things :-/ if i got this the rest is easy going (control winamp,poker,vlc,...)
greetings, phil
-
RecvAction is basically an event pump, like a WindowMessage. I don't think it is possible to call it directly like that. Granted, I've never attempted to access the ahscript.dll directly as you are doing in what? Autoit?
I have used it in JScript with the X10 SDK.
As far as I know, what you need to do is create an event handler that handles the RecvAction event broadcast by the ahscript.dll.
I hope that is at least a little help. Again, I'm not familiar with the particular tool(s) you're using or accessing the ahscript.dll directly like that.
>!
-
i got it!
you were absolutely right i had to do it a very different way
for anyone who is interested in the code:
HotKeySet("{F11}","_exit")
$x10 = ObjCreate("X10.ActiveHome")
If @error Then
MsgBox(0,"",@error)
EndIf
$x10event = ObjEvent($x10,"_x10event")
Func _x10event($parameter1,$parameter2,$parameter3,$parameter4,$parameter5,$parameter6,$parameter7)
MsgBox(0,"",$parameter1 & @CRLF & $parameter2 & "@CLF" & $parameter3 & @CRLF & $parameter4 & @CRLF & $parameter5 & @CRLF & $parameter6 & @CRLF & $parameter7)
EndFunc
Func _exit()
Exit
EndFunc
While 1
Sleep(10)
WEnd
-
Yeah!
That looks much more like how I got it to work in JScript.
Cool! 8)
Glad I could help!
>!