C
|
C++
|
Objective-C
|
VC++
|
Win32
|
MFC
|
Java
|
Php
|
Delphi
|
Visual Basic
|
.Net
|
Networking
|
General
|
Games
|
Jobs
|
Javascript
|
Menu
Project Upload
Project Download
Articles
Programs
Search
Solution
pickSourcecode.com
Login
Register
About us
Contact us
VCpp
>
Programs
VC++ - Display message box and simple window
// Header file 1
// myapp.h
class myapp : public CWinApp
{
public :
BOOL InitInstance( ) ;
} ;
// Header file 2
// myframe.h
class myframe : public CFrameWnd
{
public :
myframe( ) ;
int
OnCreate ( LPCREATESTRUCT l ) ;
DECLARE_MESSAGE_MAP( )
} ;
// Give a name as " myapp.cpp "
#include <afxwin.h>
#include "myapp.h"
#include "myframe.h"
myapp a ;
BOOL myapp::InitInstance( )
{
myframe *p ;
p = new myframe ;
m_pMainWnd = p ;
p -> ShowWindow ( SW_SHOWMAXIMIZED ) ;
return TRUE ;
}
// Give a name as "myframe.cpp "
#include <afxwin.h>
#include "myframe.h"
BEGIN_MESSAGE_MAP ( myframe, CFrameWnd )
ON_WM_CREATE( )
END_MESSAGE_MAP( )
myframe::myframe( )
{
Create ( 0, "Runtime Class" ) ;
}
int
myframe::OnCreate ( LPCREATESTRUCT l )
{
CFrameWnd::OnCreate ( l ) ;
CRuntimeClass *ptr ;
ptr = RUNTIME_CLASS ( CFrameWnd ) ;
char
str[100] ;
sprintf ( str, "%s", ptr -> m_lpszClassName ) ;
MessageBox ( str, "Class Name" ) ;
return 0 ;
}
// Output
Privacy Policy
|
About Us