Click to See Complete Forum and Search --> : assertion error when creating an mdi window


Balasubramaniam.j
March 28th, 1999, 10:36 PM
This is the other way i tried to create a mdi window but in this also

it is saying the same error.please check what error i have had done in the

code given below

Mdi.cpp

#include<afxwin.h>

#include<afxext.h>

#include "resource.h"

class Win:public CWinApp

{

public:

BOOL InitInstance();

};

class Frame:public CMDIFrameWnd

{

public:

// IMPLEMENT_DYNCREATE(Frame,CMDIFrameWnd);

Frame();

};

Frame::Frame()

{

CRect Rect(100,50,50,50);

Create(NULL,"My Window", WS_OVERLAPPEDWINDOW,Rect,this,MAKEINTRESOURCE(IDR_MAINFRAME));

}

BOOL Win::InitInstance()

{

m_pMainWnd=new Frame;

m_pMainWnd->ShowWindow(3);

m_pMainWnd->UpdateWindow();

return TRUE;

}

Win w1;

resource.h

//{{NO_DEPENDENCIES}}

// Microsoft Developer Studio generated include file.

// Used by Script2.rc

//

#define IDR_MENU1 101

#define IDR_MAINFRAME 101

#define ID_MENUITEM40001 40001

#define ID_MENUITEM40002 40002

#define ID_MENUITEM40003 40003

#define ID_MENUITEM40004 40004

// Next default values for new objects

//

#ifdef APSTUDIO_INVOKED

#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NEXT_RESOURCE_VALUE 102

#define _APS_NEXT_COMMAND_VALUE 40005

#define _APS_NEXT_CONTROL_VALUE 1000

#define _APS_NEXT_SYMED_VALUE 101

#endif

#endif

Lavrent
November 3rd, 1999, 04:19 AM
BOOL ::InitInstance()
{
...........
if (! <<Frame >> -> LoadFrame(IDR_MAINFRAME))
return FALSE;
.............
}