+ Reply to Thread
Results 1 to 2 of 2

Thread: MFC exported DLL GUI issue.

  1. #1

    MFC exported DLL GUI issue.

    Hi All,

    I have an MFC application and an MFC style DLL.

    MFC application uses exported procedure from MFC DLL but it fails.

    What could be the reason?

    Regards.

  2. #2
    Hi,

    It is not 100% clear from your question what is the actual issue.

    Let me try to answer your question.

    If you have MFC style DLL which has some resource and you want to display them like make a CDialog object and call DoModal then follow the below pattern:

    extern "C" __declspec(dllexport) void CreateDialog()
    {
    //this is the statement you should add as first statement on each exported function.
    AFX_MANAGE_STATE( AfxGetStaticModuleState( ) ) ;

    CDialog *pDialog = new CMyDialog() ;
    pDialog->DoModal() ;
    }


    For more information on AFX_MANAGE_STATE:
    http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx

    Regards.

+ Reply to Thread

Bookmarks

Posting Permissions

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