Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Elementary question on Dialogs

rahzan
New Contributor I
812 Views
A static lib includes a dialog "resource" which is later linked into a DLL.
The DLL seems to compile fine when calling the routine from the static lib.
However, when called, the DLGINIT fails.

What does this mean? Is something missing ot opeb the dialog?
The application has access to the LIB, MOD files for the static lib as well as two mystery files
in the release filder: RCA01044. and the dialog's .RES file. are these even necessary?

Thanks
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
812 Views
Every resource-loading function expects a hInstance, which describes which module (.exe/.dll) contains the resource. That includes DlgInit; by default, DlgInit tries to load the resource from .exe file, and it will fail in your case. Instead, you need the form described in DlgInitWithResourceHandle (did you RTFM for DlgInit ;-)? ). You can obtain hinst parameter either by
- saving hInstDll argument of DllMain or
- calling GetModuleHandle("mydll.dll"C).

.Res file is equivalent of .obj file. However, I'm not sure if it can be linked within a static library -- can it? Even if it can, note that There Shall Be Only One Res File Within a Module, so you cannot add any additional .rc files in containing project.

Jugoslav


0 Kudos
rahzan
New Contributor I
812 Views
Thanks,
That solved it. Also I was not aware the res file is like the obj file. I needed to add it to the command line compile commands.

Tim
0 Kudos
Reply