Opening a new MDI child when no MDI Child exists 
Author Message
 Opening a new MDI child when no MDI Child exists

This is a rewording of a message I posted on Friday, January 14, 2000.
My ISP ran out of disk space and I was not able to receive any new
messages Friday or Saturday.  Forgive me if someone has already posted a
response.


under the subject "Opening a new MDI child from a MDI Child".

------------------------------------------------------

I want to open up a child window when no child window exists (only
MAINFRAME exists).  I do not want to use FILE-OPEN processing.  I want
to click on items in my MAINFRAME toolbar (such as LOCATE-->SEARCH).

How can I open a new MDI child when no MDI child exists?

Thanks in advance.

Chuck Davis



Fri, 05 Jul 2002 03:00:00 GMT  
 Opening a new MDI child when no MDI Child exists
ASSUMING your MDI window is tied into a CMultiDocTemplate you
could use the OpenDocumentFile of this class.


Fri, 05 Jul 2002 03:00:00 GMT  
 Opening a new MDI child when no MDI Child exists
You can create a new frame using CDocTemplate::CreateNewFrame().

--
Ajay Kalra

Microsoft VC++/MFC MVP

NOTE: Please post all replies to newsgroup.


Quote:
> This is a rewording of a message I posted on Friday, January 14, 2000.
> My ISP ran out of disk space and I was not able to receive any new
> messages Friday or Saturday.  Forgive me if someone has already posted a
> response.


> under the subject "Opening a new MDI child from a MDI Child".

> ------------------------------------------------------

> I want to open up a child window when no child window exists (only
> MAINFRAME exists).  I do not want to use FILE-OPEN processing.  I want
> to click on items in my MAINFRAME toolbar (such as LOCATE-->SEARCH).

> How can I open a new MDI child when no MDI child exists?

> Thanks in advance.

> Chuck Davis



Fri, 05 Jul 2002 03:00:00 GMT  
 Opening a new MDI child when no MDI Child exists


Fri, 19 Jun 1992 00:00:00 GMT  
 Opening a new MDI child when no MDI Child exists
Ajay,

I'm having trouble getting this to work.  In my MainFrame module, I have a
function that executes whenever someone clicks LOCATE-->SEARCH (I want
to click on items in my MAINFRAME toolbar such as LOCATE-->SEARCH and have the
function to create a new frame/view/document.).  In this module, I have
        CDocTemplate * pmyDoc;
         pmyDoc = CDocTemplate::CreateNewFrame(NULL, NULL);
However, I get error C2352 illegal call of non-static member function.

Obviously, I'm not on the right track.

Can someone give me an example on how this is done?

Chuck

Quote:

> You can create a new frame using CDocTemplate::CreateNewFrame().

> --
> Ajay Kalra

> Microsoft VC++/MFC MVP

> NOTE: Please post all replies to newsgroup.



> > This is a rewording of a message I posted on Friday, January 14, 2000.
> > My ISP ran out of disk space and I was not able to receive any new
> > messages Friday or Saturday.  Forgive me if someone has already posted a
> > response.


> > under the subject "Opening a new MDI child from a MDI Child".

> > ------------------------------------------------------

> > I want to open up a child window when no child window exists (only
> > MAINFRAME exists).  I do not want to use FILE-OPEN processing.  I want
> > to click on items in my MAINFRAME toolbar (such as LOCATE-->SEARCH).

> > How can I open a new MDI child when no MDI child exists?

> > Thanks in advance.

> > Chuck Davis



Sat, 06 Jul 2002 03:00:00 GMT  
 Opening a new MDI child when no MDI Child exists
You're not accessing the doc template object - you can't just call a class
function without an object......

Look in yourapp.cpp, where AppWizard creates the Doc Template, usuallt
pDocTemplate - you might have to access it via the Doc object itself, though
i am not sure how to do this

Here's what you should of done...

(Assuming your app defined doc template is called pDocTemplate and you want
to access it directly)

pDocTemplate.CreateNewFrame(NULL, NULL);

or if you are accessing a pointer to it(via some call to the doc object to
get the doc template)...

pDocTemplate->CreateNewFrame(NULL, NULL);

In C++, you have classes and objects. CDocTemplate is a class - and your
document template(the object that defines what type of document your app
excepts, usually defined as a string in the resource file) is an instance of
that class. So when a programmer writes CDocTemplate::CreateNewFrame() we're
actually saying, get the object of type CDocTemplate and then call the
CreateNewFrame function of that object - by whatever name that object is.

Hope this helps,

Josh


Quote:
> Ajay,

> I'm having trouble getting this to work.  In my MainFrame module, I have a
> function that executes whenever someone clicks LOCATE-->SEARCH (I want
> to click on items in my MAINFRAME toolbar such as LOCATE-->SEARCH and have
the
> function to create a new frame/view/document.).  In this module, I have
>         CDocTemplate * pmyDoc;
>          pmyDoc = CDocTemplate::CreateNewFrame(NULL, NULL);
> However, I get error C2352 illegal call of non-static member function.

> Obviously, I'm not on the right track.

> Can someone give me an example on how this is done?

> Chuck


> > You can create a new frame using CDocTemplate::CreateNewFrame().

> > --
> > Ajay Kalra

> > Microsoft VC++/MFC MVP

> > NOTE: Please post all replies to newsgroup.



> > > This is a rewording of a message I posted on Friday, January 14, 2000.
> > > My ISP ran out of disk space and I was not able to receive any new
> > > messages Friday or Saturday.  Forgive me if someone has already posted
a
> > > response.


asked
> > > under the subject "Opening a new MDI child from a MDI Child".

> > > ------------------------------------------------------

> > > I want to open up a child window when no child window exists (only
> > > MAINFRAME exists).  I do not want to use FILE-OPEN processing.  I want
> > > to click on items in my MAINFRAME toolbar (such as LOCATE-->SEARCH).

> > > How can I open a new MDI child when no MDI child exists?

> > > Thanks in advance.

> > > Chuck Davis



Sun, 07 Jul 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Opening a new MDI child from a MDI Child

2. How develop MDI application with child forms like VB MDI and Child forms

3. How to create an MDI App without an initial MDI Child opening by the framework

4. MDI open new child windows

5. Change MDI child caption and Close child window button

6. Change MDI child caption and Close child window button

7. DataView filter not working in MDI child forms with reference to MDI parent DataSet

8. MFC MDI Multiple Views in Separate MDI Child Windows

9. Variables between MDI and MDI-child...

10. Communication between MDI Parent and MDI Child

11. getting all open MDI child windows from CMainFrame

12. Start an MDI App without an open Child Window

 

 
Powered by phpBB® Forum Software