新建的头文件,其中的函数使用MessageBox时报错,如何解决?

解决方案 »

  1.   

    我的代码:MessageBox( strTemp, "错误!", MB_ICONSTOP ) ;报错:error C2660: 'MessageBoxA' : function does not take 3 parameters
      

  2.   

    新建的头文件中加上#include "stdafx.h"试试吧
      

  3.   

    新建的头文件中加上#include "stdafx.h"试试吧---------------------还是老样子啊。
      

  4.   

    MessageBox( NULL,strTemp, "错误!", MB_ICONSTOP ) ; 
      

  5.   

    MessageBox( strTemp, "错误!", MB_ICONSTOP ) ; 改为
    MessageBox( NULL,strTemp, "错误!", MB_ICONSTOP ) ; 

    MessageBox(AfxGetApp()->GetMainWnd()->GetSafeHwnd(),strTemp, "错误!", MB_ICONSTOP ) ;