CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Doc-View Architechture

    I have an application (MDI) built over the document-view type of architecture of MFC. I have the following problems.
    how ....
    To get a pointer to an application object from document class?
    To get a pointer to a frame window object from document class?

    2. Regarding to CMDIChldWnd
    To get a pointer to an application object from frame window class ?
    To get a pointer to a document template object from frame window class?
    To get a pointer to a document object from frame window class?GetActiveDocument()?
    To get a pointer to a view object from frame window class? GetActiveView()?
    3. Regarding to CView Class
    To get a pointer to a document template object from CView class?
    To get a pointer to an application object from CView class ?

    Since I have two types of frameworks in my Application how can i access one from the other?
    Waiting for a reply,
    Thanks in advance
    Tapan



  2. #2
    Join Date
    Apr 1999
    Posts
    383

    Re: Doc-View Architechture

    > To get a pointer to an application object from document class?

    CWinApp* pApp = AfxGetApp();

    To get a pointer to a frame window object from document class?

    POSITION pos = GetFirstViewPosition();
    CView* pView = GetNextView(pos);
    CFrameWnd* pFrm = pView->GetParentFrame();

    > To get a pointer to an application object from frame window class ?

    CWinApp* pApp = AfxGetApp();

    > To get a pointer to a document template object from frame window class?

    CDocTemplate* pDocTemplate = GetActiveDocument()->GetDocTemplate();

    > To get a pointer to a document object from frame window class?
    > GetActiveDocument()?

    Yes.

    > To get a pointer to a view object from frame window class? GetActiveView()?

    Yes.

    > To get a pointer to a document template object from CView class?

    CDocTemplate* pDocTemplate = GetDocument()->GetDocTemplate();

    > To get a pointer to an application object from CView class ?

    CWinApp* pApp = AfxGetApp();

    Dave



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured