Activex controls in modal dialog boxes

Activex controls in modal dialog boxes

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?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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)).


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):

lret = DlgSetSub(dlg,IDD_MY_DIALOGBOX_CONTAINING_AN_ACTIVEX_CONTROL,callback_function_containing_activex_control_processing,DLG_INIT)
iret = DlgModal(dlg)

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").


Leave a Comment

Please sign in to add a comment. Not a member? Join today