- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page