Help: CView with MDI vs. SDI 
Author Message
 Help: CView with MDI vs. SDI

Here is the MDI code in the CMainFrm:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
      if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
            return -1;

     .......................

Quote:
}

It's said that the call to CMDIFrameWnd::OnCreate(), through the
message hierarchy and function calling, will call
CFrameWnd::CreateView, which
creates the corresponding CView (VMyView)object. However, it doesn't!
(I traced
into it without going into the CMyView::CMyView(). It's under MDI.

However, another SDI program, such call:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{      
        if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
                return -1;
......

will directthe process into CMyView::CMyView()!

Please help! How to make the MDI code also do it? Thanks very much!!



Sat, 27 Aug 2005 22:10:31 GMT  
 Help: CView with MDI vs. SDI
The view class named in the creation of your document template will
normally be created, as you say, in the CreateView function.  If not,
you have something non-normal happening.  I suggest that you step into
the call to OnCreate and follow it until you learn why it doesn't create
the view (via a call to the CreateObject function of the view's
CRuntimeClass object).


says...

Quote:
> Here is the MDI code in the CMainFrm:

> int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
> {
>       if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
>             return -1;

>      .......................
> }

> It's said that the call to CMDIFrameWnd::OnCreate(), through the
> message hierarchy and function calling, will call
> CFrameWnd::CreateView, which
> creates the corresponding CView (VMyView)object. However, it doesn't!
> (I traced
> into it without going into the CMyView::CMyView(). It's under MDI.

> However, another SDI program, such call:

> int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
> {  
>    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
>            return -1;
> ......

> will directthe process into CMyView::CMyView()!

> Please help! How to make the MDI code also do it? Thanks very much!!



Mon, 29 Aug 2005 07:09:52 GMT  
 Help: CView with MDI vs. SDI
Thanks! I found out that I commented off the code in
CChildFrame::PreCreateWindow(CREATESTRUCT& cs)!


Quote:
> The view class named in the creation of your document template will
> normally be created, as you say, in the CreateView function.  If not,
> you have something non-normal happening.  I suggest that you step into
> the call to OnCreate and follow it until you learn why it doesn't create
> the view (via a call to the CreateObject function of the view's
> CRuntimeClass object).


> says...
> > Here is the MDI code in the CMainFrm:

> > int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
> > {
> >       if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
> >             return -1;

> >      .......................
> > }

> > It's said that the call to CMDIFrameWnd::OnCreate(), through the
> > message hierarchy and function calling, will call
> > CFrameWnd::CreateView, which
> > creates the corresponding CView (VMyView)object. However, it doesn't!
> > (I traced
> > into it without going into the CMyView::CMyView(). It's under MDI.

> > However, another SDI program, such call:

> > int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
> > {    
> >       if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
> >               return -1;
> > ......

> > will directthe process into CMyView::CMyView()!

> > Please help! How to make the MDI code also do it? Thanks very much!!



Mon, 29 Aug 2005 19:48:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dialog box pop-up - SDI vs. MDI apps

2. MDI vs SDI Applications

3. MDI vs SDI

4. SDI vs. MDI apps

5. SDI vs MDI or multithreading?

6. Dialog box pop-ups - SDI vs. MDI apps

7. MDI vs SDI

8. SDI vs. MDI memory

9. mdi vs sdi display problems

10. SDI vs MDI, or mulththreading?

11. HELP: SDI Application and CView

12. CView::OnDraw vs CView::OnPaint

 

 
Powered by phpBB® Forum Software