读书人

windows核心编程-运行程序异常

发布时间: 2012-01-20 18:53:53 作者: rapoo

windows核心编程---运行程序错误
我现在刚开始学习Windows核心编程,但是运行第一章得程序有错误,我用得是vc6++
//////////////////////////////////////////////////////////////////////
Compiling...
ErrorShow.cpp
F:\windows核心编程\windows核心编程\01-ErrorShow\ErrorShow.cpp(140) : error C2664: 'DialogBoxParamA ' : cannot convert parameter 4 from 'long (struct HWND__ *,unsigned int,unsigned int,long) ' to 'int (__stdcall *)(struct HWND__ *,unsigned int,unsi
gned int,long) '
None of the functions with this name in scope match the target type
Error executing cl.exe.
////////////////////////////////////////////////////////////
出错的代码:
DialogBoxParam(hinstExe, MAKEINTRESOURCE(IDD_ERRORSHOW),
NULL, Dlg_Proc, _ttoi(pszCmdLine));
我把Winuser.h和windows.h都包进去了,但是运行就是通不过,请高手帮帮忙

[解决办法]
Dlg_Proc的声明有错误。
int __stdcall Dlg_Proc

回调函数必须用__stdcall修饰

读书人网 >VC/MFC

热点推荐