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

Thread: DoModal failed

Threaded View

  1. #1
    Join Date
    Dec 2008
    Posts
    9

    DoModal failed

    Hello,

    I created one MFC extension DLL (Say DllA) that uses another extension dll in which classes are exported. In DllA I have created a dialog. I made one exported function from the and that (DllA) function simply call DoModal() on the object of Dialog class.

    ShowAsaeDlg()
    {
    ADialog ADlg;
    ADlg.DoModal;
    }


    Also created one MFC application which uses above created dll and give call to the exported function. Code is as below.


    GetModuleFileName(NULL, szModulePath, MAX_PATH);
    GetShortPathName(szModulePath, szModulePath, MAX_PATH);
    _tcscat(szModulePath, _T("ADll.dll"));


    hAsaeDll = LoadLibrary (szModulePath);
    pfnShowAsaeDlg = (PFN_SHOWASAEDLG)GetProcAddress(hAsaeDll, "ShowAsaeDlg");
    pfnShowAsaeDlg();

    This simple code does not works. DoModal returns -1.

    Can anybody help me on this.

    Regards,
    Avirat
    Last edited by avirat; May 21st, 2010 at 06:43 AM.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)