Non MFC modal dialogs in an MFC application - Dialog Message problem 
Author Message
 Non MFC modal dialogs in an MFC application - Dialog Message problem

I have an MFC client application that is partly converted from a  Win32 SDK
based application. The application consists of several modeless and modal
dialogs.
To be able to handle dialogmessages (Tab-key, dialog accellerators etc.) a
global HWND (hWndCurrent) has been created. This HWND is set equal to the
current windows HWND (or NULL) in response to WM_ACTIVATE (in the non MFC
dialogs). In my CWinApp::PreTranslateMessage i call IsDialogMessage() using
hWndCurrent.
This works fine in all cases exept when i open a non MFC modal dialog
(DialogBoxParam() function). If the user switches to a modeless dialog when
the modal dialog is still open CWinApp::PreTranslateMessage is not called.
The result is that the Tab-key, dialog accellerators etc stops working for
the modeless dialog. When the user closes the modal dialog the Tab-key,
dialog accellerators etc work fine.
With MFC based modal dialogs there is no problem.

Will I have to rewrite every non MFC modal dialog or can someone help me
with this?

I use:
Visual C++ 5.0
MFC 4.21

Jarle Jacobsen



Mon, 30 Jul 2001 03:00:00 GMT  
 Non MFC modal dialogs in an MFC application - Dialog Message problem
You will have to override Run, but I suggest that you, even if the task
might be dreary, convert the dialogs. If they are developing, the
productivity gains in the future will be non-trivial - speaking from
experience of this kind of situation.

Johan Rosengren
Responsable Informatique
PACTA S.A.



Tue, 31 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Showing a modal dialog in a modal dialog application

2. mfc dialog in non-mfc?

3. MFC Dialog parented by a non-MFC window

4. Calling MFC (dialog) from non-MFC framework

5. non-mfc app needs to domodal on mfc dialog example

6. Message reflection and non-modal dialogs

7. Problem using MFC modal dialog with long animation refresh

8. Adding MFC-code to a non MFC Application(WIN-application)

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

10. Adding Another MFC Dialog to the Dialog base application

11. creating Modal vs. Non-Modal dialogs

12. Derive a MFC dialog from an existing MFC Dialog

 

 
Powered by phpBB® Forum Software