Jump to content

Recommended Posts

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
Posted

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.

Posted

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
×
×
  • Create New...