Monday, April 1, 2013

visual c++(mfc) program to display simple message box

visual c++(mfc) program to display simple message box.

#include<afxwin.h>
class myframe:public CFrameWnd
{
public:
myframe()
{
Create(0,"my mfc");
}
OnLButtonDown()
{
    MessageBox("do u want to save?","hai",MB_YESNOCANCEL|MB_ICONQUESTION);
}
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(myframe,CFrameWnd)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
class myapp:public CWinApp
{
public:
virtual BOOL InitInstance()
{
m_pMainWnd=new myframe();
m_pMainWnd->ShowWindow(1);
m_pMainWnd->UpdateWindow();
return TRUE;
}
};
myapp app;

 Visual c++
An application development tool developed by Microsoft for C++ programmers. Visual C++ supports object-oriented programming of 32-bit Windows applications with an integrated development environment (IDE), a C/C++ compiler, and a class library called the Microsoft Foundation Classes (MFC). The IDE includes an AppWizard, ClassWizard, and testing features to make programming easier. Visual C++ was introduced in 1993, and Release 4.0 became available in 1996.

No comments:

Post a Comment