- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am developing a C++ GUI for a computationally intensive Fortran code. I plan to place the Fortran code in a DLL as it only requires the passing of a string argument. My problem is I'm not sure how to implement a progress dialog in the Fortran DLL that will be compatible with the C++ GUI. Can someone please give me some advice on how to get this done.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See the DIALOGDLLPRGRS sample provided with recent versions of CVF.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay, so I took your ThreadDlg example, converted it to a subroutine, put it into a DLL and linked it to my C++ dialog based app. I also included the DllMain function from DLLPRGRS and swapped in DlgInitWithResourceHandle. The program compiles and runs fine, I get the dialog from the C++ main but I don't see the Fortran DLL's dialog. When I debug it the Dlg argument looks reasonable but when I hit DlgModal it just skips right over it and no dialog appears on the screen. Any suggestions would be greatly appreaciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, can't tell you offhand why it fails. What does GetLastError() say? Off the top of my head, I can only think of failure to call InitCommonControls(), required because of progress bar (it loads comctl32.dll and registers window classes; frequently, it is loaded by other dlls so it usually works even without that call, so I tend to forget it ) -- the error message would be "Cannot find window class" in this case.
But anyway, I meant that sample only as illustration of the technique. A better approach will be that you create and manage the dialog on C++ side, and leave only number crunching in Fortran; for updating, provide a callback function, passed through Dll's arg-list. See here for a relevant info.
Jugoslav
But anyway, I meant that sample only as illustration of the technique. A better approach will be that you create and manage the dialog on C++ side, and leave only number crunching in Fortran; for updating, provide a callback function, passed through Dll's arg-list. See here for a relevant info.
Jugoslav

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