Creating a SDI window from a dialog
-
Hi there! [edit]: Sorry, wrong Message board. I'll post it on the VC++/MFC Board [/edit] We've got a real big problem, allthough it seems to be not really difficult: Our main application is a dialog which definitely MUST remain a dialog. My colleague wants to create a SDI window from this dialog by clicking on a specific button. Still no problem. The problem ist, that the window seems not to get the windows messages: Usually if you create a method to handle a mouseclick on a button in the toolbar, you can also create a function
OnUpdateClickXXX(CCmdUI* pCmdUI)
for example you could gray a specific button, if ButtonXXX is being clicked on. But OnUpdateClickXXX is never called! For me it seems, that the WM_PAINT message is being processed just by the dialog. the SDI window is created withCSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CSDI_LeerDoc), RUNTIME_CLASS(CMainFrame), RUNTIME_CLASS(CSDI_LeerView)); AfxGetApp()->AddDocTemplate(pDocTemplate); //because i am in the dialog, i have to call AfxGetApp() to register the doctemplate with the application
when you click on a button in the dialog. All OnClickBlah, OnUpdateBlah... methods are inserted by the class wizard, and the AFX_MESSAGE_MAP has the correct ON_COMMAND, ON_UPDATE_COMMAND...entries Could you give us some hints, where we could look for that problem? Sure, the problem is caused by the dialog "standing" between the application and the doc/view. Thank you all, and i hope you can help us with our problem. Sascha Billian