CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    1

    Dialog doesn't show in explicitly loaded dll

    Hi,

    I have a control panel applet that shows a dialog by calling an exported function with a LoadLibrary and GetProcAddress. This "C" externed function resides in a dll that is dynamicaly linked to MFC. The control panel applet is a simple win32 dll.
    As the documentation reads, I am calling "AFX_MANAGE_STATE(AfxGetStaticModuleState());" at the begining of the function.

    The _DEBUG version works fine. The release does not.

    In the release version, the dialog never show up. The return value from DoModal is IDABORT.

    Any ideas?

    TIA


  2. #2
    Join Date
    Nov 2001
    Posts
    1

    Re: Dialog doesn't show in explicitly loaded dll

    Hi, guy, showing Dialog(linked with a resource) in DLL is a little tricky.
    you can change project-settings to achieve this. I developed a MFC DLL with a Dialog resource, and I created a CMyDialog (subclass of CDialog) with that resource. the DLL also export an "extern "C" function. In that function I create an instance CMyDialog dlg; and called dlg.domodal().
    At first, it cannnot work, which I thought quite similar to your problem.
    The solution is to change project-settings.
    I make the DLL 'statically' linked to MFC, and all problems settled.

    any questions email to [email protected]
    development discussion are all welcomed.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured