Monday, April 1, 2013

VISUAL C++,mfc program TO CREATE A WINDOW WITH A MENU BAR

            /*TO CREATE A WINDOW WITH A MENUBAR*/


#include<afxwin.h>
#include"resource.h"
class myframe:public CFrameWnd
{
public:
    myframe()                                                 
    {
        Create(0,"my program",WS_OVERLAPPEDWINDOW,rectDefault,0,MAKEINTRESOURCE(IDR_MENU1));
    }
};
class myapp:public CWinApp              
{
public:
    virtual BOOL InitInstance()
    {
        m_pMainWnd=new myframe();
        m_pMainWnd->ShowWindow(1);             
        m_pMainWnd->UpdateWindow();
        return TRUE;
    }
};
myapp app;

1 comment:

  1. Resource.h is not available when included in the program. How to rectify this ?

    ReplyDelete