I have tired to create mdi window in two ways but in both the case it is

displaying the same error and if i ignore it it is displaying the mdi window please any one of you solve it for me

and tell me what is the mistake that i have done so i could rectify it.

i am enclosing my code below.

prog 1

#include<afxwin.h>

#include<afxext.h>

#include "resource.h"

class Winublic CWinApp

{

public:

BOOL InitInstance();

};

class Frameublic CMDIFrameWnd

{

public:

Frame();

afx_msg int PreCreateWindow(CREATESTRUCT &cs);

afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);

DECLARE_MESSAGE_MAP()

};

BEGIN_MESSAGE_MAP(Frame,CMDIFrameWnd)

ON_WM_CREATE()

END_MESSAGE_MAP()

Frame::Frame()

{

}

int Frame::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)

return -1;

return 0;

}

int Frame::PreCreateWindow(CREATESTRUCT &cs)

{

return CMDIFrameWnd::PreCreateWindow(cs);

}

BOOL Win::InitInstance()

{

Frame* pMainFrame = new Frame;

if (!pMainFrame->LoadFrame(IDR_MAINFRAME))

return FALSE;

m_pMainWnd = pMainFrame;

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