Click here to Skip to main content
15,905,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMDI Childs Pin
baerten19-Oct-06 22:28
baerten19-Oct-06 22:28 
Hi everyone,

Now, if i will create a new MDI Child Window, i add a Template in the App
So, if i have 3 Child-Windows i must add 3 Templates ...

i add a template like this :

pDocTemplate = new CMultiDocTemplate(IDR_FCustomerSearch,
RUNTIME_CLASS(CMyProjectDoc), // I dont use Doc's
RUNTIME_CLASS(FCustomerSearch),
RUNTIME_CLASS(FCustomerSearchView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);

and i open the window like this:

void CMainFrame::OpenWindow(CString Name)
{
CString Cur;
CDocTemplate *Selected;
POSITION pos = theApp.GetFirstDocTemplatePosition();
while(pos != NULL) {
Selected = (CDocTemplate*)theApp.GetNextDocTemplate(pos);
ASSERT(Selected != NULL);
ASSERT(Selected->IsKindOf(RUNTIME_CLASS(CDocTemplate)));

Selected->GetDocString(Cur,CDocTemplate::docName);
if(Name == Cur) {
Selected->OpenDocumentFile(NULL);
}
}
}

Is it correct? or exists another, better possibility ?

Because if i have f.ex. 25 Child frames, i have a very long list of
Templates-Additions ...


Thanks Smile | :)
QuestionRe: MDI Childs Pin
prasad_som20-Oct-06 0:08
prasad_som20-Oct-06 0:08 
QuestionRe: MDI Childs [modified] Pin
baerten20-Oct-06 1:08
baerten20-Oct-06 1:08 
Questionmemory leaks using pdh library Pin
m.dietz19-Oct-06 21:48
m.dietz19-Oct-06 21:48 
Questionhow to... Pin
Bravoone_200619-Oct-06 21:01
Bravoone_200619-Oct-06 21:01 
AnswerRe: how to... Pin
Hamid_RT20-Oct-06 0:09
Hamid_RT20-Oct-06 0:09 
AnswerRe: how to... Pin
David Crow20-Oct-06 3:35
David Crow20-Oct-06 3:35 
QuestionWaitForSingleObject Pin
LiYS19-Oct-06 20:20
LiYS19-Oct-06 20:20 
AnswerRe: WaitForSingleObject Pin
Cedric Moonen19-Oct-06 20:38
Cedric Moonen19-Oct-06 20:38 
GeneralRe: WaitForSingleObject Pin
LiYS19-Oct-06 20:52
LiYS19-Oct-06 20:52 
GeneralRe: WaitForSingleObject Pin
Cedric Moonen19-Oct-06 20:59
Cedric Moonen19-Oct-06 20:59 
GeneralRe: WaitForSingleObject Pin
LiYS19-Oct-06 21:17
LiYS19-Oct-06 21:17 
GeneralRe: WaitForSingleObject Pin
Cedric Moonen19-Oct-06 22:31
Cedric Moonen19-Oct-06 22:31 
Questionhow to resolve this issue? Pin
gentleguy19-Oct-06 20:13
gentleguy19-Oct-06 20:13 
AnswerRe: how to resolve this issue? Pin
ThatsAlok19-Oct-06 20:19
ThatsAlok19-Oct-06 20:19 
AnswerRe: how to resolve this issue? Pin
Cedric Moonen19-Oct-06 20:29
Cedric Moonen19-Oct-06 20:29 
AnswerRe: how to resolve this issue? Pin
David Crow20-Oct-06 3:40
David Crow20-Oct-06 3:40 
QuestionTwo Joystick and DirectInput Pin
akira3219-Oct-06 18:33
akira3219-Oct-06 18:33 
Questionis this the only way to do OLEDB coonection Pin
With_problem19-Oct-06 16:36
With_problem19-Oct-06 16:36 
AnswerRe: is this the only way to do OLEDB coonection Pin
Mark Salsbery19-Oct-06 17:55
Mark Salsbery19-Oct-06 17:55 
Question[question] Inheritance and access level Pin
w2520n252019-Oct-06 16:24
w2520n252019-Oct-06 16:24 
AnswerRe: [question] Inheritance and access level Pin
Mark Salsbery19-Oct-06 18:05
Mark Salsbery19-Oct-06 18:05 
QuestionDirect3D image scramples when the screensaver comes up Pin
lastgen19-Oct-06 15:39
lastgen19-Oct-06 15:39 
QuestionI need help,who can help me of this project? Pin
alphaxz19-Oct-06 15:32
alphaxz19-Oct-06 15:32 
AnswerRe: I need help,who can help me of this project? Pin
Hamid_RT19-Oct-06 20:55
Hamid_RT19-Oct-06 20:55 

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.