mfc版的各位朋友,大家好!小弟第一次到这儿来,先散100分,请各位接分(来者有分)顺便问一个关于hello,world程序的问题。我刚学完c++,就迫不及待地来到这儿。由于我学vc++都是自学的,以后可能会问一些超级菜问题,还请各位帮忙!另外我现在手头只有李久进的mfc深入浅出,电子版的vc++技术内幕,我准备买侯捷的mfc深入浅出。请各位给点建议!
我的问题如下:
class CMyApp:public CWinApp
{ public:
virtual bool InitInstance();
};
class CMyFrame:public CFrameWnd
{ public:
CMyFrame();
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
}; //这是myapp.h文件
#include <afxwin.h>
#include "myapp.h"
CMyApp theApp;
bool CMyApp::InitInstance()
{ m_pMainWnd=new CMyFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return true;
}
BEGIN_MESSAGE_MAP(CMyFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT()
END_MESSAGE_MAP()
CMyFrame::CMyFrame()
{ Create(NULL,"MYAPP Application");
}
void CMyFrame::OnLButtonSown(UINT nFlags,CPoint point)
{ TRACE("Entering CMyFrame::OnLButtonDown - %1x,%d,%d\n",(long)nFlags,point,x,pont.y);}
void CMyFrame::OnPaint()
{ CPaintDC dc(this);
dx.TextOUt(0.0."Hello,World!");
}
这个程序有8个错误,哪位帮我改一下?谢了!
我的问题如下:
class CMyApp:public CWinApp
{ public:
virtual bool InitInstance();
};
class CMyFrame:public CFrameWnd
{ public:
CMyFrame();
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
}; //这是myapp.h文件
#include <afxwin.h>
#include "myapp.h"
CMyApp theApp;
bool CMyApp::InitInstance()
{ m_pMainWnd=new CMyFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return true;
}
BEGIN_MESSAGE_MAP(CMyFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT()
END_MESSAGE_MAP()
CMyFrame::CMyFrame()
{ Create(NULL,"MYAPP Application");
}
void CMyFrame::OnLButtonSown(UINT nFlags,CPoint point)
{ TRACE("Entering CMyFrame::OnLButtonDown - %1x,%d,%d\n",(long)nFlags,point,x,pont.y);}
void CMyFrame::OnPaint()
{ CPaintDC dc(this);
dx.TextOUt(0.0."Hello,World!");
}
这个程序有8个错误,哪位帮我改一下?谢了!
解决方案 »
- 在tab控件里创建了一个对话框通过ModifyStyle由child修改到popup为什么显示后还在tab控件里不能拖动?求解
- 如何修改MFC程序中ICON的尺寸
- 怎么用GetPrivateProfileString获取ini里多行数据?
- FreeLibrary的问题
- 想将传输的数据进行加密,但是加密中文后解密出来的是乱码?
- 在VC++里面怎么获得目标设备的水平分辨率,单位是象素/米
- ADO 与 DAO 的问题
- 请教下面错误
- VC高手请进——关于文件操作
- 有关BCG资源奇怪的问题?
- 在普通IE下打开一张网页,怎样访问其HTML源文件?
- 怎么样把一个sdi变成mdi,需要在那些地方进行修改呢?(在线等)
nFlags,point,x,pont.y);
该为nFlags,point.x,point.y);dx.TextOUt(0.0."Hello,World!");
改为dc.TextOUt(0,0,"Hello,World!");
up
{
public:
virtual BOOL InitInstance();
};
class CMyFrame:public CFrameWnd
{
public:
CMyFrame();
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
}; //这是myapp.h文件
//#include <afxwin.h>
//#include "myapp.h"
CMyApp theApp;
BOOL CMyApp::InitInstance()
{
m_pMainWnd=new CMyFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}BEGIN_MESSAGE_MAP(CMyFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT()
END_MESSAGE_MAP()CMyFrame::CMyFrame()
{
Create(NULL,"MYAPP Application");
}void CMyFrame::OnLButtonDown(UINT nFlags,CPoint point)
{
TRACE("Entering CMyFrame::OnLButtonDown - %x,%d,%d\n",(long)nFlags,point.x,point.y);}
void CMyFrame::OnPaint()
{
CPaintDC dc(this);
dc.TextOut(0,0,"Hello,World!");
}
{
public:
virtual BOOL InitInstance();
};
class CMyFrame:public CFrameWnd
{
public:
CMyFrame();
protected:
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
}; //这是myapp.h文件
#include <afxwin.h>
#include "myapp.h"
CMyApp theApp;
BOOL CMyApp::InitInstance()
{
m_pMainWnd=new CMyFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}BEGIN_MESSAGE_MAP(CMyFrame,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT()
END_MESSAGE_MAP()CMyFrame::CMyFrame()
{
Create(NULL,"MYAPP Application");
}void CMyFrame::OnLButtonDown(UINT nFlags,CPoint point)
{
TRACE("Entering CMyFrame::OnLButtonDown - %x,%d,%d\n",(long)nFlags,point.x,point.y);}
void CMyFrame::OnPaint()
{
CPaintDC dc(this);
dc.TextOut(0,0,"Hello,World!");
}