Re: Want to solve: Warning: Creating a pane with no CDocument



Typcially the frame gets created automatically during the call
ProcessShellCommand, when it calls CWinApp::OnFileNew

AliR.

"Eric Lilja" <mindcoolerremoveme@xxxxxxxxx> wrote in message
news:ehvfzbZmHHA.2272@xxxxxxxxxxxxxxxxxxxxxxx
Scott McPhillips [MVP] skrev:
Eric Lilja wrote:
Hello, I have doc-view program (SDI-type). My frame window class creates
a CSplitterWnd with two panes. I'm getting the message in the subject
when creating the pane views: Warning: Creating a pane with no
CDocument. What have I done wrong? I've cut down the implementation of
my frame window to:
FrameWindow.h:
#pragma once

#include "stdafx.h"

class FrameWindow : public CFrameWnd
{
public:
FrameWindow();

protected:
virtual BOOL LoadFrame(UINT, DWORD, CWnd *, CCreateContext *);

virtual BOOL OnCreateClient(LPCREATESTRUCT, CCreateContext *);

DECLARE_DYNCREATE(FrameWindow)

private:
/* The docs say: A CSplitterWnd object is usually embedded in a
parent CFrameWnd or CMDIChildWnd object. */
CSplitterWnd splitter_;
};

FrameWindow.cpp:
#include "FrameWindow.h"
#include "WindowView.h"

IMPLEMENT_DYNCREATE(FrameWindow, CFrameWnd)

FrameWindow::FrameWindow()
{
VERIFY(Create(NULL, _T("Show Styles"), WS_OVERLAPPEDWINDOW, CRect(10,
10, 1024, 768)));
}



Why do you call the frame Create in the constructor. This is probably
the source of the problem. MFC normally creates the frame for you, after
the CDocument object exists.


Well, seems I'm mis-using something...how does it know what parameters it
should pass? I have no resources in this project.


.



Relevant Pages

  • Re: Want to solve: Warning: Creating a pane with no CDocument
    ... a CSplitterWnd with two panes. ... when creating the pane views: Warning: Creating a pane with no CDocument. ... virtual BOOL LoadFrame(UINT, DWORD, CWnd *, CCreateContext *); ... Why do you call the frame Create in the constructor. ...
    (microsoft.public.vc.mfc)
  • Want to solve: Warning: Creating a pane with no CDocument
    ... My frame window class creates a CSplitterWnd with two panes. ... I'm getting the message in the subject when creating the pane views: Warning: Creating a pane with no CDocument. ... virtual BOOL LoadFrame(UINT, DWORD, CWnd *, CCreateContext *); ...
    (microsoft.public.vc.mfc)
  • Re: Want to solve: Warning: Creating a pane with no CDocument
    ... What's the value of pContext->m_pCurrentDoc in your OnCreateClient? ... CSplitterWnd with two panes. ... creating the pane views: Warning: Creating a pane with no CDocument. ... virtual BOOL LoadFrame(UINT, DWORD, CWnd *, CCreateContext *); ...
    (microsoft.public.vc.mfc)
  • Re: Want to solve: Warning: Creating a pane with no CDocument
    ... BOOL Application::InitInstance ... a CSplitterWnd with two panes. ... I'm getting the message in the subject when creating the pane views: Warning: Creating a pane with no CDocument. ... virtual BOOL LoadFrame(UINT, DWORD, CWnd *, CCreateContext *); ...
    (microsoft.public.vc.mfc)
  • Re: Want to solve: Warning: Creating a pane with no CDocument
    ... a CSplitterWnd with two panes. ... I'm getting the message in the subject when creating the pane views: Warning: Creating a pane with no CDocument. ... Why do you call the frame Create in the constructor. ...
    (microsoft.public.vc.mfc)

Loading