CWinApp::OnFileNew
-
Is there any way to call the CWinApp::OnFileNew except from cliking on the menu item with the default ID_FILE_NEW ; Because Of the fact the CWinApp::OnFileNew is a protected member function of CWinApp i Couldn't call AfxGetApp()->OnFileNew() Then I tried ON_REGISTERED_MESSAGE(MY_REGISTERED_MESSAGE,CWinApp::OnFileNew) and i posted the message from my CView function but didn't work as i expected. So maybe i was thinking I could fake the effect of cliking on the the menu or pressing the accelerator combination so that i can have the result something like you know FireCommand(ID_FILE_NEW); then the handler of CWinApp ON_COMMAND(ID_FILE_NEW,CWinApp::OnFileNew) does the required job Is there any way to get around this :confused::confused::confused::confused:
-
Is there any way to call the CWinApp::OnFileNew except from cliking on the menu item with the default ID_FILE_NEW ; Because Of the fact the CWinApp::OnFileNew is a protected member function of CWinApp i Couldn't call AfxGetApp()->OnFileNew() Then I tried ON_REGISTERED_MESSAGE(MY_REGISTERED_MESSAGE,CWinApp::OnFileNew) and i posted the message from my CView function but didn't work as i expected. So maybe i was thinking I could fake the effect of cliking on the the menu or pressing the accelerator combination so that i can have the result something like you know FireCommand(ID_FILE_NEW); then the handler of CWinApp ON_COMMAND(ID_FILE_NEW,CWinApp::OnFileNew) does the required job Is there any way to get around this :confused::confused::confused::confused:
How To Create New Documents Without CWinApp::OnFileNew Same idea applies to an SDI app.
:cool: Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
-
Is there any way to call the CWinApp::OnFileNew except from cliking on the menu item with the default ID_FILE_NEW ; Because Of the fact the CWinApp::OnFileNew is a protected member function of CWinApp i Couldn't call AfxGetApp()->OnFileNew() Then I tried ON_REGISTERED_MESSAGE(MY_REGISTERED_MESSAGE,CWinApp::OnFileNew) and i posted the message from my CView function but didn't work as i expected. So maybe i was thinking I could fake the effect of cliking on the the menu or pressing the accelerator combination so that i can have the result something like you know FireCommand(ID_FILE_NEW); then the handler of CWinApp ON_COMMAND(ID_FILE_NEW,CWinApp::OnFileNew) does the required job Is there any way to get around this :confused::confused::confused::confused:
Get a pointer to your document template, and call
OpenDocumentFile(NULL)
on it. This will create a new document.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"