![]() |
Introduction to CRunTime |
This introductory program illustrates the use of the CRunTime class:
#include <afxwin.h>
class myframe :public CFrameWnd
{
public:
myframe()
{
Create(0,"james");
}
void Display()
{
CRuntimeClass *ptr;
ptr=RUNTIME_CLASS(CFrameWnd);
CString Res;
Res.Format("%s",ptr->m_lpszClassName);
AfxMessageBox(Res,MB_OK);
}
};
class myapp:public CWinApp
{
public:
int InitInstance()
{
myframe *p=new myframe;
p->ShowWindow(3);
p->Display();
m_pMainWnd=p;
return 1;
}
};
myapp a;
|
|
|
||
| Home | Copyright © 2006 J. James Prasanna. | |
|
|
||