Re: Displaying Dialog from DLL by r_z_aret
r_z_aret
Thu Aug 21 13:15:50 CDT 2003
I don't use MFC, so I was hoping someone would give you an
MFC-specific solution. No one has, so I'll offer something that might
help.
In straight Win32, the functions that load resources need an HINST
that points to the location of the resource. If the resource is in the
executable, then NULL works. If the resource is in a DLL, then the
functions need the HINST for that DLL. This value is passed as an
argument to DllMain (sorry, that is a common name for the function,
but I can't remember its more general name). It can also be obtained
by calling LoadLibrary and casting the return value from HMODULE to
HINST. I've seen a recent thread discussing the relative merits of
these two.
You might try looking through the MFC source code. Not something I
like to do, but sometimes worth the effort. And all Visual Studio
users have access to it.
On Tue, 19 Aug 2003 16:08:22 -0600, "Brian Westcott"
<bwestcott@home.com> wrote:
>When I attempt to display a Dialog box from a DLL, CDialog::DoModal cannot
>find the dialog resource. I suspect that the resource is being looked for in
>the EXE file and not the dll file. Can anyone tell me how I can pont the S/W
>to the correct resource using CDialog?
>
>
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com