Activex controls in modal dialog boxes

Activex controls in modal dialog boxes

Imagen de hbell

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?

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de Jugoslav Dujic

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

Jugoslav www.xeffort.com
Imagen de hbell

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




Inicie sesión para dejar un comentario.