Click here to Skip to main content
15,924,317 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MyAtlCtrlInstace->PassMetafile(hMyMetafile) ( VT_METAFILE) Pin
Mazdak20-Feb-02 4:02
Mazdak20-Feb-02 4:02 
GeneralRe: MyAtlCtrlInstace->PassMetafile(hMyMetafile) ( VT_METAFILE) Pin
Braulio Dez20-Feb-02 4:09
Braulio Dez20-Feb-02 4:09 
GeneralRe: MyAtlCtrlInstace->PassMetafile(hMyMetafile) ( VT_METAFILE) Pin
Mazdak20-Feb-02 4:32
Mazdak20-Feb-02 4:32 
GeneralProblems with inheritance Pin
20-Feb-02 3:22
suss20-Feb-02 3:22 
GeneralRe: Problems with inheritance Pin
Joaquín M López Muñoz20-Feb-02 3:25
Joaquín M López Muñoz20-Feb-02 3:25 
GeneralRe: Problems with inheritance Pin
Stan Shannon20-Feb-02 4:10
Stan Shannon20-Feb-02 4:10 
GeneralMDI application Pin
20-Feb-02 1:51
suss20-Feb-02 1:51 
GeneralRe: MDI application Pin
Jonathan Craig20-Feb-02 3:12
Jonathan Craig20-Feb-02 3:12 
To create a new doc/view at a later time save the doc template pointer in your applications header file:
CMultiDocTemplate *m_pMyDocTemplate;
Use it when the doc template is created:
m_pMyDocTemplate = new CMultiDocTemplate(
    IDR_TARGETTYPE,
    RUNTIME_CLASS(CMyDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CMyView));
AddDocTemplate(m_pMyDocTemplate);
When you are ready to create a new doc/view call this:
m_pMyDocTemplate->OpenDocumentFile(NULL, TRUE);
If you call AddDocTemplate() above you do not have to delete the m_pMyDocTemplate pointer when the application ends. If you don't call AddDocTemplate() you will need to delete the m_pMyDocTemplate pointer.

To keep the default new doc/view from showing add the code below:
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
 
//ADD ME! - Start
//Don't show a new doc if the command line is empty.
if(cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew)
    cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
//ADD ME! - End
 
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
	return FALSE;
Hope this helps. Smile | :)

Jonathan Craig
www.mcw-tech.com
General24 errors Pin
-Dy20-Feb-02 0:48
-Dy20-Feb-02 0:48 
GeneralRe: 24 errors Pin
Roger Allen20-Feb-02 1:22
Roger Allen20-Feb-02 1:22 
GeneralRe: 24 errors Pin
-Dy20-Feb-02 1:51
-Dy20-Feb-02 1:51 
GeneralRe: 24 errors Pin
Sef Tarbell20-Feb-02 10:23
Sef Tarbell20-Feb-02 10:23 
GeneralHour Glass Pin
AJ12320-Feb-02 0:44
AJ12320-Feb-02 0:44 
Generalconverting a class to a reusable compiled object Pin
Kuniva20-Feb-02 0:44
Kuniva20-Feb-02 0:44 
GeneralRe: converting a class to a reusable compiled object Pin
Jon Hulatt20-Feb-02 0:56
Jon Hulatt20-Feb-02 0:56 
GeneralRe: converting a class to a reusable compiled object Pin
Joaquín M López Muñoz20-Feb-02 2:12
Joaquín M López Muñoz20-Feb-02 2:12 
QuestionHow Do I Detect Activity In a CEdit Control ? Pin
MJ_Karas20-Feb-02 0:37
MJ_Karas20-Feb-02 0:37 
AnswerRe: How Do I Detect Activity In a CEdit Control ? Pin
Jon Hulatt20-Feb-02 0:58
Jon Hulatt20-Feb-02 0:58 
GeneralRe: How Do I Detect Activity In a CEdit Control ? Pin
MJ_Karas20-Feb-02 16:03
MJ_Karas20-Feb-02 16:03 
GeneralDriverName Pin
19-Feb-02 23:50
suss19-Feb-02 23:50 
Questionhow do I Change the Font size of DrawText? Pin
John Cruz19-Feb-02 23:35
John Cruz19-Feb-02 23:35 
AnswerRe: how do I Change the Font size of DrawText? Pin
Roger Allen19-Feb-02 23:42
Roger Allen19-Feb-02 23:42 
GeneralATL IDataObject Pin
Braulio Dez19-Feb-02 23:36
Braulio Dez19-Feb-02 23:36 
QuestionHow to Change Shot-Cut Key of F1 Pin
louis19-Feb-02 22:41
louis19-Feb-02 22:41 
AnswerRe: How to Change Shot-Cut Key of F1 Pin
Roger Allen19-Feb-02 23:38
Roger Allen19-Feb-02 23:38 

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.