|
-
March 28th, 1999, 11:36 PM
#1
assertion error when creating an mdi window
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 ublic CWinApp
{
public:
BOOL InitInstance();
};
class Frame ublic 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
-
November 3rd, 1999, 05:19 AM
#2
Re: assertion error when creating an mdi window
BOOL ::InitInstance()
{
...........
if (! <<Frame >> -> LoadFrame(IDR_MAINFRAME))
return FALSE;
.............
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|