Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: A letter to webmaster/author Pin
toxcct1-Mar-07 5:16
toxcct1-Mar-07 5:16 
GeneralRe: A letter to webmaster/author Pin
Software_Specialist1-Mar-07 5:28
Software_Specialist1-Mar-07 5:28 
QuestionRe: A letter to webmaster/author Pin
Hamid_RT1-Mar-07 6:32
Hamid_RT1-Mar-07 6:32 
AnswerRe: A letter to webmaster/author Pin
toxcct1-Mar-07 21:40
toxcct1-Mar-07 21:40 
GeneralRe: A letter to webmaster/author Pin
ThatsAlok1-Mar-07 21:40
ThatsAlok1-Mar-07 21:40 
GeneralRe: A letter to webmaster/author Pin
Programm3r1-Mar-07 20:10
Programm3r1-Mar-07 20:10 
GeneralRe: A letter to webmaster/author Pin
toxcct1-Mar-07 21:43
toxcct1-Mar-07 21:43 
QuestionCreating a SDI window from a dialog (MFC) Pin
sascha.billian1-Mar-07 3:48
sascha.billian1-Mar-07 3:48 
Hi there!

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 with

CSingleDocTemplate* pDocTemplate;<br />
  pDocTemplate = new CSingleDocTemplate(<br />
  IDR_MAINFRAME,<br />
  RUNTIME_CLASS(CSDI_LeerDoc),<br />
  RUNTIME_CLASS(CMainFrame),       <br />
  RUNTIME_CLASS(CSDI_LeerView));<br />
  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

Sascha Billian
AnswerRe: Creating a SDI window from a dialog (MFC) Pin
Mark Salsbery1-Mar-07 7:28
Mark Salsbery1-Mar-07 7:28 
GeneralRe: Creating a SDI window from a dialog (MFC) Pin
sascha.billian1-Mar-07 8:32
sascha.billian1-Mar-07 8:32 
QuestionRe: Creating a SDI window from a dialog (MFC) Pin
Mark Salsbery1-Mar-07 8:53
Mark Salsbery1-Mar-07 8:53 
AnswerRe: Creating a SDI window from a dialog (MFC) Pin
led mike1-Mar-07 11:38
led mike1-Mar-07 11:38 
GeneralRe: Creating a SDI window from a dialog (MFC) Pin
sascha.billian5-Mar-07 2:08
sascha.billian5-Mar-07 2:08 
GeneralRe: Creating a SDI window from a dialog (MFC) Pin
led mike5-Mar-07 6:42
led mike5-Mar-07 6:42 
GeneralRe: Creating a SDI window from a dialog (MFC) Pin
sascha.billian6-Mar-07 19:41
sascha.billian6-Mar-07 19:41 
QuestionRead from file into array Pin
JBAK_CP1-Mar-07 3:42
JBAK_CP1-Mar-07 3:42 
AnswerRe: Read from file into array Pin
David Crow1-Mar-07 3:46
David Crow1-Mar-07 3:46 
GeneralRe: Read from file into array Pin
JBAK_CP1-Mar-07 3:53
JBAK_CP1-Mar-07 3:53 
GeneralRe: Read from file into array Pin
David Crow1-Mar-07 3:58
David Crow1-Mar-07 3:58 
QuestionProblems with project from VS2003 in VS2005 Pin
Asdef Jaker1-Mar-07 3:21
Asdef Jaker1-Mar-07 3:21 
QuestionRe: Problems with project from VS2003 in VS2005 Pin
prasad_som1-Mar-07 3:40
prasad_som1-Mar-07 3:40 
QuestionRe: Problems with project from VS2003 in VS2005 Pin
Asdef Jaker1-Mar-07 4:27
Asdef Jaker1-Mar-07 4:27 
QuestionRe: Problems with project from VS2003 in VS2005 Pin
prasad_som1-Mar-07 5:34
prasad_som1-Mar-07 5:34 
AnswerRe: Problems with project from VS2003 in VS2005 Pin
Chris Losinger1-Mar-07 5:29
professionalChris Losinger1-Mar-07 5:29 
AnswerRe: Problems with project from VS2003 in VS2005 Pin
Michael Dunn1-Mar-07 5:54
sitebuilderMichael Dunn1-Mar-07 5:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.