Run-Time Check Failure #0 - 错误问题
来源:互联网 发布:mac virtualbox传文件 编辑:程序博客网 时间:2024/05/02 02:03
很久没写代码,一天几行的代码:
typedef int ( *PFUN)(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);
void CTestProcessMonitorDlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
//MessageBox(TEXT("Hello"), TEXT("Test"));
//typedef void (*pfv) ();
HMODULE hmod = ::LoadLibraryExW(TEXT("user32.dll"), NULL, 0);
if (hmod != NULL)
{
PFUN pFun= (PFUN)GetProcAddress(hmod, "MessageBoxW");
if (pFun != NULL)
{
pFun(m_hWnd, TEXT("Hello"), TEXT("Test"), MB_YESNO);
}
:FreeLibrary(hmod);
}
}
突然出现以下的错误:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
代码改为如下, 则问题没有了
typedef int (WINAPI *PFUN)(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);
void CTestProcessMonitorDlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
//MessageBox(TEXT("Hello"), TEXT("Test"));
//typedef void (*pfv) ();
HMODULE hmod = ::LoadLibraryExW(TEXT("user32.dll"), NULL, 0);
if (hmod != NULL)
{
PFUN pFun= (PFUN)GetProcAddress(hmod, "MessageBoxW");
if (pFun != NULL)
{
pFun(m_hWnd, TEXT("Hello"), TEXT("Test"), MB_YESNO);
}
::FreeLibrary(hmod);
}
}
// 调用约定出现问题,以前这样调用api也没有用上WINAPI , 现在突然就需要了,很是迷惑??? 盼知情者指点!
- Run-Time Check Failure #0 - 错误问题
- Run-Time Check Failure #0错误
- Run-Time Check Failure #0错误
- Run-Time Check Failure #0 错误
- Run-Time Check Failure #0 错误小结
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- Run-Time Check Failure #0
- 调用DLL函数,出现错误 Run-Time Check Failure #0
- Run-Time Check Failure
- HTMLDocument3 getElementById Run-Time Check Failure #0
- jsp:include参数传送接收与应用
- 原来串口也有DB-25的....
- cocos2d-x初探学习笔记(7)--CCProgressTimer
- jQuery:收集一些基于jQuery框架开发的控件/jquery插件。(2)
- hdu 3283 The Next Permutation
- Run-Time Check Failure #0 - 错误问题
- 网站兼容性(二)
- js和jsp互相取值
- 用扑克牌Love
- 插件式设计的架构模型与实例
- 在vc2008中试验网络上的程序代码例子
- 第i小元素
- java环境变量的设置
- s-t最大流问题AMPL代码