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个错误,哪位帮我改一下?谢了!

解决方案 »

  1.   

    有几个输错了。现改正如下:
    nFlags,point,x,pont.y);
    该为nFlags,point.x,point.y);dx.TextOUt(0.0."Hello,World!");
    改为dc.TextOUt(0,0,"Hello,World!");
      

  2.   

    dx.TextOUt(0.0."Hello,World!");  //这也错了吧
    up
      

  3.   

    #include <afxwin.h>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::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!");
    }
      

  4.   

    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::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!");
    }