CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Aug 2006
    Posts
    231

    Showing dialog in DLL

    I create a dynamic library, using "MFC in a Shared DLL".

    I export a test method:

    h-file:
    Code:
    class CMyClass  
    {
    public:
      __declspec(dllexport) void Test();
    };
    cpp-file:
    Code:
    void CMyClass::Test()
    {
      CDialog1 dlg;
      dlg.DoModal();
    
      DWORD dw = GetLastError();
    }
    CDialog1 is just a new dialog created with resource editor. It's empty, except for buttons "OK" and "Cancel".

    When method "Test" is called from another MFC application, the dialog is not shown and GetLastError returns error 87 "The parameter is incorrect". I've also tried using macro AFX_MANAGE_STATE, but same error. (Attached zipped project).

    Please help. What parameter?? What do I need to add (or change) to show the dialog?
    Attached Files Attached Files

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