Please login or register.

Login with username, password and session length

Author Topic: i dont get "RecvAction" to work in ahscript.dll (autoit)  (Read 6276 times)

marbobley

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
i dont get "RecvAction" to work in ahscript.dll (autoit)
« on: September 16, 2010, 12:07:59 PM »

here is my code:

Code: [Select]
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
Logged

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: i dont get "RecvAction" to work in ahscript.dll (autoit)
« Reply #1 on: September 17, 2010, 12:28:33 AM »

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.

 >!
Logged
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

marbobley

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: i dont get "RecvAction" to work in ahscript.dll (autoit)
« Reply #2 on: September 17, 2010, 10:26:36 PM »

i got it!


you were absolutely right i had to do it a very different way

for anyone who is interested in the code:

Code: [Select]
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
Logged

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: i dont get "RecvAction" to work in ahscript.dll (autoit)
« Reply #3 on: September 17, 2010, 10:31:11 PM »

Yeah!

That looks much more like how I got it to work in JScript.

Cool!   8)

Glad I could help!
 >!
Logged
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.