목차
없음
본문내용
::ExitInstance();
};
virtual BOOL InitInstance();
};
class CMainFrame : public CFrameWnd
{
public:
CMainFrame();
protected:
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
// 응용 프로그램 객체
CHelloApp theApp;
// 클래스 정의부
BOOL CHelloApp::InitInstance()
{
m_pMainWnd = new CMainFrame;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
CMainFrame::CMainFrame()
{
Create(NULL, "HelloMFC Application");
}
void CMainFrame::OnPaint()
{
char *msg = "Hello, MFC";
CPaintDC dc(this);
dc.TextOut(100, 100, msg, lstrlen(msg));
}
void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point)
{
MessageBox("마우스를 클릭했습니다.", "마우스 메시지");
}
// 메세지맵
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
};
virtual BOOL InitInstance();
};
class CMainFrame : public CFrameWnd
{
public:
CMainFrame();
protected:
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
// 응용 프로그램 객체
CHelloApp theApp;
// 클래스 정의부
BOOL CHelloApp::InitInstance()
{
m_pMainWnd = new CMainFrame;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
CMainFrame::CMainFrame()
{
Create(NULL, "HelloMFC Application");
}
void CMainFrame::OnPaint()
{
char *msg = "Hello, MFC";
CPaintDC dc(this);
dc.TextOut(100, 100, msg, lstrlen(msg));
}
void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point)
{
MessageBox("마우스를 클릭했습니다.", "마우스 메시지");
}
// 메세지맵
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()