Scott McPhillips [MVP] a ?crit :
mosfet wrote:
Hi,
I am wondering if it would be possible to change the default doc/view
initialization defined like this :
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CVoxQADoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CVoxQAView));
in a default project doc/view creates the first view but since I am
managing views myself I would like to create the first view inside
the MainFrame::OnCreate and add it to the Document.
Is it possible ?
You can pass NULL instead of a view class to suppress the view
creation here.
In this case Do i need to declare A CChildView ?
or if I do this it should work ?
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
CMyView * pView = new CMyView();
if (!pView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
{
TRACE0("Failed to create view window\n");
return -1;
}