Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28446 Discussions

Activex controls in modal dialog boxes

hbell
Beginner
644 Views
The CVF Fortran examples of using Activex Controls all seem to be used with modeless dialog boxes. Does anybody know whether they can be used in modal dialog boxes as well? Example code?
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
644 Views
I've never used ActiveX controls, but in principle they should work equally well in modal dialog boxes. I'd just point out the principal difference between modal and modeless dialogs: after you call DlgModeless, your app continues execution and you can do whatever you need to do with ActiveX (or any other control) after that. However, after you call DlgModal, the execution "stops". So, everything must be done from dialog's callback functions in that case. Typically, if you need initialization of ActiveX control (or any "non-standard" control) you'll put it in dialog's init-callback (DlgSetSub(Dlg, IDD_DIALOG1, OnDlgInit)).

Jugoslav
0 Kudos
hbell
Beginner
644 Views
Thanks. This worked. Note, the callback function to initialize the activex control (called init-callback by Jugoslav) actually has four arguments with the last being "DLG_INIT". Key lines in preparation to the call to DlgModal (containing long, self-evident names) were as follows (note especially the calling sequence):

call COMINITIALIZE(iret)
...
lret=DlgInit(IDD_MY_DIALOGBOX_CONTAINING_AN_ACTIVEX_CONTROL,dlg)
...
lret = DlgSetSub(dlg,IDD_MY_DIALOGBOX_CONTAINING_AN_ACTIVEX_CONTROL,callback_function_containing_activex_control_processing,DLG_INIT)
...
iret = DlgModal(dlg)
...
call COMUNINITIALIZE()

The callback function I called "callback_function_containing_activex_control_processing", makes calls to the Activex functions as they are translated with the Fortran Module Wizard (for this process see Help Index under "Activex Controls using Fortran").

Harry




0 Kudos
Reply