Sign in to follow this  
Followers 0
MilesAhead

event sink and line by line execution

4 posts in this topic

#1 ·  Posted (edited)

I think I know what's happening but I've been wrong before so...

What I'm running into is I have an ActiveX Control that I wrote

that puts up standard Windows Message Dialogs but with some custom

background painting routines. The issue is if you add a Help Button

to the dialog by assigning a help context of other than -1, when it's

pressed, the event isn't processed in AutoIt3 until the dialog is dismissed.

The event handler works as expected in VC++, VB, Delphi so I'm thinking

perhaps the issue is that even though the AutoIt3 script is compiled, it's

still being executed a line at a time.

I'll post the AutoIt3 script and perhaps someone can verify my suspicion.

;simple example usage of GradDlgX ActiveX Control
;
$grad = ObjCreate("GradDlgXControl1.GradDlgX")
$sinkObject = ObjEvent($grad, "DoHelpEvent_","IGradDlgXEvents")
$grad.GradStyle = 1; use 0 for metalic gradient look

If $grad.ConfirmDlg("Sure you want to do this?", True, 1, 5) = 1 Then
    $grad.InfoDlg("You Pressed OK", True, 0, -1)
EndIf

$sinkObject = 0
$grad = 0

;help event when you press Help button in GradDlg.
;works in compiled languages(Delphi, VC++, VB, even C#) but in AutoIt3 the event
;only fires after the modal dialog is closed(i.e. OK or Cancelis pressed)
Func DoHelpEvent_OnContextHelp($HelpCtx)
    MsgBox(0x40000, "Grad Test Help", "This is some Help for Help Context " _
       & String($HelpCtx))
EndFunc;==>DoHelpEvent_OnContextHelp
Edited by MilesAhead

Share this post


Link to post
Share on other sites



I'm pretty sure since Autoit is a scritping language and interpreted it will be read a line at a time. I can't quite say for 100% but most scripting languages I know of behave this way. The exe file isn't really a binary exe like one would expect if I remember. It's nothing but the script and a real binary file (the interpreter) in one file.

Share this post


Link to post
Share on other sites

Thanks for the reply. That's what I thought. I'm still trying to figure out where to declare and create an event sink in Python so I could try it out for the same behavior there.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0