- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hopefully this is a simple question but probably not.
I have a visual basic program calling a fortran dll to do some simulation. The fortran program takes some time to compute so I have added a progress bar in a resource file. The dll compiles fine but I can't get the dialog to initialize or show. Looking in the documentation it says I need to use the
DLGINITWITHRESOURCE command instead of the DLGINIT since the dialog is in the dll. Visual basic calls right into the dll subroutine and passes about 30 characters, integers and real numbers. They pass okay back and forth. DLGINITWITH RESOURCE needs a module instance handler which it says is given to DLLMAIN when the dll is called, except my visual basic program entries into the subroutine directly (TSSFOR) since it is passing numerous data. All of the initialization commands return zero so they are not successful and the program crashes on the DLGMODELESS command saying that the program is trying to reference memory which cannot be read.
How do I get the module instance handler and am I on the right track that I need it?
I have a visual basic program calling a fortran dll to do some simulation. The fortran program takes some time to compute so I have added a progress bar in a resource file. The dll compiles fine but I can't get the dialog to initialize or show. Looking in the documentation it says I need to use the
DLGINITWITHRESOURCE command instead of the DLGINIT since the dialog is in the dll. Visual basic calls right into the dll subroutine and passes about 30 characters, integers and real numbers. They pass okay back and forth. DLGINITWITH RESOURCE needs a module instance handler which it says is given to DLLMAIN when the dll is called, except my visual basic program entries into the subroutine directly (TSSFOR) since it is passing numerous data. All of the initialization commands return zero so they are not successful and the program crashes on the DLGMODELESS command saying that the program is trying to reference memory which cannot be read.
How do I get the module instance handler and am I on the right track that I need it?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can get hInstance using DFWIN function GetModuleFileName("mydll.dll"C). Note that this would fail if a) someone renames your dll or b) possibly if there are multiple instances of different dlls with the same name loaded. However, for practical reasons I think this would suffice.
Jugoslav
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apologies for the typo, that should be GetModuleHandle -- GetModuleFileName does the reverse thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Graham,
An additional suggestion. You should check out the CVF dllprgrs sample in ..Microsoft Visual StudioDF98SAMPLESDIALOGDLLPRGRS. The description of this sample reads The dllprgrs sample demonstrates using the Visual Fortran Dialog Procedures in a DLL. (with a progress bar no less)
hth,
JT
An additional suggestion. You should check out the CVF dllprgrs sample in ..Microsoft Visual StudioDF98SAMPLESDIALOGDLLPRGRS. The description of this sample reads The dllprgrs sample demonstrates using the Visual Fortran Dialog Procedures in a DLL. (with a progress bar no less)
hth,
JT

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