checkabdoul
asked on
Multiple Windows
Hi
First of all, a big hi from me to all the
gurus here.
I recently started MFC programming, and I would
like to do the following.
I want to create multiple windows ( SDI's)
from a single application at the same time.
All of them should behave as normal windows
in their own sense. It means, I should be
able to minimize, maximize etc,,etc,,
should be able to have child controls within
them.
In a nutshell, if i run the final application
( say multi.exe ), I should be able to create
more than 1 window at the same time.
Can somebody tell me, how I could accomplish
this using MFC.
Thanks in advance.
Cheers
Check A.C.S
First of all, a big hi from me to all the
gurus here.
I recently started MFC programming, and I would
like to do the following.
I want to create multiple windows ( SDI's)
from a single application at the same time.
All of them should behave as normal windows
in their own sense. It means, I should be
able to minimize, maximize etc,,etc,,
should be able to have child controls within
them.
In a nutshell, if i run the final application
( say multi.exe ), I should be able to create
more than 1 window at the same time.
Can somebody tell me, how I could accomplish
this using MFC.
Thanks in advance.
Cheers
Check A.C.S
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The problem is that an SDI takes over the whole MainFrame. You can't have more than one SDI running, hence the 'S' in SDI meaning 'Single'.
MDI's ARE 2 or more different SDI independent of each other running the same application.
I guess the question is: "What features of MDI do you not like that you are trying to stay away from?"
Phillip
MDI's ARE 2 or more different SDI independent of each other running the same application.
I guess the question is: "What features of MDI do you not like that you are trying to stay away from?"
Phillip
ASKER
Hi Phillip Davis,
Thanks for the reply.
>> The problem is that an SDI takes over the whole MainFrame. You can't have more than one SDI running, hence the 'S' in SDI meaning 'Single'.
MDI's ARE 2 or more different SDI independent of each other running the same application.
I guess the question is: "What features of MDI do you not like that you are trying to stay away from?"
Yes.. You are right. The exact feature of MDI that I do not want is, I do not want this two SDI's of mine to be stuck withing the MDI umbrella. I want these 2 SDI's to have their own toolbar, statusbar, menu..etc..etc...
It is like I want to have more than 1 window from a single application. These windows created can be MDI's or SDI's or modeless dialog boxes..
Thanks again for your replies Phillip Davis.
Check A.C.S
Thanks for the reply.
>> The problem is that an SDI takes over the whole MainFrame. You can't have more than one SDI running, hence the 'S' in SDI meaning 'Single'.
MDI's ARE 2 or more different SDI independent of each other running the same application.
I guess the question is: "What features of MDI do you not like that you are trying to stay away from?"
Yes.. You are right. The exact feature of MDI that I do not want is, I do not want this two SDI's of mine to be stuck withing the MDI umbrella. I want these 2 SDI's to have their own toolbar, statusbar, menu..etc..etc...
It is like I want to have more than 1 window from a single application. These windows created can be MDI's or SDI's or modeless dialog boxes..
Thanks again for your replies Phillip Davis.
Check A.C.S
> The exact feature of MDI that I do not want is, I do not want this two SDI's of mine to be stuck withing the MDI umbrella.
> I want these 2 SDI's to have their own toolbar, statusbar, menu
AHHH, but they don't have to!! Create yourself multiple templates! For example, add yourself some CMultiDocTemplates to your application header...
CMultiDocTemplate* m_pCountryTemplate;
CMultiDocTemplate* m_pSignatureTemplate;
m_pCountryTemplate = new CMultiDocTemplate(
IDR_COUNTRYTYPE,
RUNTIME_CLASS(CCountryDoc) ,
RUNTIME_CLASS(CCountryChil dFrame), // custom MDI child frame
RUNTIME_CLASS(CCountryView ));
AddDocTemplate(m_pCountryT emplate);
m_pSignatureTemplate = new CMultiDocTemplate(
IDR_SIGNATURETYPE,
RUNTIME_CLASS(CSignatureDo c),
RUNTIME_CLASS(CSignatureCh ildFrame), // custom MDI child frame
RUNTIME_CLASS(CSignatureVi ew));
AddDocTemplate(m_pSignatur eTemplate) ;
Did you notice the IDR_COUNTRYTYPE and IDR_SIGNATURETYPE parts? That's where you get your multiple toolbars and menus. Just create a menu and a toolbar for each of the resource IDs. Now when they are created via the
pApp->m_pCategoryTemplate- >OpenDocum entFile( NULL );
command, then you will get your MDI window open with it's specific toolbar and specific menu. Voila!
Phillip
> I want these 2 SDI's to have their own toolbar, statusbar, menu
AHHH, but they don't have to!! Create yourself multiple templates! For example, add yourself some CMultiDocTemplates to your application header...
CMultiDocTemplate* m_pCountryTemplate;
CMultiDocTemplate* m_pSignatureTemplate;
m_pCountryTemplate = new CMultiDocTemplate(
IDR_COUNTRYTYPE,
RUNTIME_CLASS(CCountryDoc)
RUNTIME_CLASS(CCountryChil
RUNTIME_CLASS(CCountryView
AddDocTemplate(m_pCountryT
m_pSignatureTemplate = new CMultiDocTemplate(
IDR_SIGNATURETYPE,
RUNTIME_CLASS(CSignatureDo
RUNTIME_CLASS(CSignatureCh
RUNTIME_CLASS(CSignatureVi
AddDocTemplate(m_pSignatur
Did you notice the IDR_COUNTRYTYPE and IDR_SIGNATURETYPE parts? That's where you get your multiple toolbars and menus. Just create a menu and a toolbar for each of the resource IDs. Now when they are created via the
pApp->m_pCategoryTemplate-
command, then you will get your MDI window open with it's specific toolbar and specific menu. Voila!
Phillip
ASKER
First of all thanks for the quick reply.
But oops!!!! That is not what I am looking for.
( Sorry for not mentioning it clearly. I know about those MDI's and all other stuff related to that. Even though I am relatively new to MFC programming, I had been developing windows applications for the past 4 years. I know those windows jargons.
No offense meant.)
I do not want to have child windows within MDI's ( which is relatively simple!Right!!). What I want is 2 or more different SDI's, independant of each other running in the same application.
It could also be an MDI and an SDI created at the same time from one single application. How could I accomplish this ?
Please let me know, if i am not clear about what I am talking about.
Thanks and Have a nice day
Check A.C.S