CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    8

    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 Winublic CWinApp

    {

    public:

    BOOL InitInstance();

    };

    class Frameublic 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



  2. #2
    Join Date
    Apr 1999
    Posts
    10

    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
  •  





Click Here to Expand Forum to Full Width

Featured