problem with displaying dialogs from dlls in the main window 
Author Message
 problem with displaying dialogs from dlls in the main window

Hi,

I have a little problem.

My programm is modul-based and the dlls need to display dialogs in the
window of the main-programm, so I pass the CWND - Pointer of the
MainWindow (AfxGetMainWnd) to the dlls.

In the dlls there are the resources and a normal class derrived from
cdialog. What I do is to construct an object of my dialog-class with
such a constructor:

MyDialogClass dialog_obj (_cwnd_main_window)

With this constructor the dialog-object should know in which window to
display the dialog, but of course the domodal returns -1, which means
that it fails to create the dialog.

The de{*filter*} shows me that the m_hwnd member of the dialog_obj is
NULL, but what have I done wrong?

Thanks a lot in advance,
Chris.



Mon, 29 Apr 2002 03:00:00 GMT  
 problem with displaying dialogs from dlls in the main window

Quote:
>With this constructor the dialog-object should know in which window to
>display the dialog, but of course the domodal returns -1, which means
>that it fails to create the dialog.

>The de{*filter*} shows me that the m_hwnd member of the dialog_obj is
>NULL, but what have I done wrong?

Chris,

Have you used AFX_MANAGE_STATE(AfxGetStaticModuleState( )) in the
entry point of your DLLs functions so that the MFC code will use the
resource handle of your DLL to read the resources?

Dave
--
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Tue, 30 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Display a dialog window before the main Window

2. displaying dialog box with my main window..

3. Displaying Dialog Box On the Main Window

4. displaying dialog box with my main window..

5. main dialog window is blocked by second dialog window

6. PBM: Message box not displayed after main dialog box is closed in MFC dialog-based app

7. Dialog owned by main window not hidden when main minimized

8. Problem opening dialog before main window

9. Generic Thunking and Windows NT: Cannot display dialog boxes in the DLL

10. Dialog box as a main window in windows 95, using Win32 SDK only (MSVC 5.00)

11. Q: Display variable in main window

12. How to change the main frame window text display

 

 
Powered by phpBB® Forum Software