在程序中某段代码中,有:if(***)MessageBox("here is the root of the tree","",MB_OK);
竟然报告说:'MessageBoxA' : function does not take 3 parameters
明显是睁眼说瞎话嘛.
你认为这是怎么回事呢?

解决方案 »

  1.   

    你检查一下是不是使用这个MessageBox函数了MessageBox(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType);
      

  2.   

    int MessageBox(          HWND hWnd,
        LPCTSTR lpText,
        LPCTSTR lpCaption,
        UINT uType
    );上面要改成:
    if(***)MessageBox(NULL,"here is the root of the tree","",MB_OK);
      

  3.   

    最好是
    if(***)
       ::MessageBox(NULL,"here is the root of the tree","",MB_OK);
      

  4.   

    CWnd::MessageBox
    int MessageBox( LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, UINT nType = MB_OK );你可能不是在CWnd或CWnd的继承类中使用,所以调用的并不是CWnd::MessageBox
    或者你可以改用AfxMessageBox。AfxMessageBox 
    int AfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 );
    int AFXAPI AfxMessageBox( UINT nIDPrompt, UINT nType = MB_OK, UINT nIDHelp = (UINT) -1 );
      

  5.   

    因为你在全局中调用的这个函数,是不行的一般我们在使用这个函数的时候调用的是CWnd的,所以只有三个参数,如果在非这个类或其子类下调用,当然就会使用全局4个参数的MessageBox了解决办法很简单
    MFC专门为了解决这个框架窗口问题,制做了一系列Afx开头的框架函数...即使用:AfxMessageBox();