Re: Want to solve: Warning: Creating a pane with no CDocument
- From: "AliR \(VC++ MVP\)" <AliR@xxxxxxxxxxxxx>
- Date: Fri, 18 May 2007 22:06:06 GMT
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.
.
- Follow-Ups:
- Re: Want to solve: Warning: Creating a pane with no CDocument
- From: Eric Lilja
- Re: Want to solve: Warning: Creating a pane with no CDocument
- References:
- Want to solve: Warning: Creating a pane with no CDocument
- From: Eric Lilja
- Re: Want to solve: Warning: Creating a pane with no CDocument
- From: Scott McPhillips [MVP]
- Re: Want to solve: Warning: Creating a pane with no CDocument
- From: Eric Lilja
- Want to solve: Warning: Creating a pane with no CDocument
- Prev by Date: Re: Want to solve: Warning: Creating a pane with no CDocument
- Next by Date: Re: Want to solve: Warning: Creating a pane with no CDocument
- Previous by thread: Re: Want to solve: Warning: Creating a pane with no CDocument
- Next by thread: Re: Want to solve: Warning: Creating a pane with no CDocument
- Index(es):
Relevant Pages
|
Loading