Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.
2012-08-10 01:47
344 查看
调用IIS管理组件时编写了下面一段代码,调用函数时提示错误: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.
国外论坛不少人也提过这个问题将Calling Convention由原来的__cdecl (/Gd)修改为__stdcall (/Gz),其实是因为IUnknown被转换为IDispatch的问题。
std::wcout.imbue(std::locale("chs")); ::CoInitialize(NULL); CLSID clsid; HRESULT hr = ::CLSIDFromProgID(PROGID_WRITABLEADMINMANAGER, &clsid); CComPtr pAdminMgr; hr = ::CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, reinterpret_cast(&pAdminMgr)); CComVariant vtServerPath(XLOG_CFGSECTION_SERVER_XPATH); CComVariant vtAppHost(CFG_PATH_APPHOST); CComVariant vtServerConfigSection; hr = pAdminMgr.PutPropertyByName(_T("CommitPath"), &vtAppHost);
国外论坛不少人也提过这个问题将Calling Convention由原来的__cdecl (/Gd)修改为__stdcall (/Gz),其实是因为IUnknown被转换为IDispatch的问题。
相关文章推荐
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. 解决办法
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.... 此错误的解
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.... 此错误的解决方法
- C++程序在debug模式下遇到Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call问题。
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. 错误解决
- Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.... 此错误的解
- MFC开发遇到的异常Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call
- 【Dll】Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call
- 调用DLL函数,出现错误 Run-Time Check Failure #0 - The value of ESP was not properly saved across a function
- Run-Time Check Failure #0,The value of ESP was not properly saved 错误解决
- Run-Time Check Failure #0,The value of ESP was not properly saved
- Run-Time Check Failure #0,The value of ESP was not properly saved 错误解决
- Run-Time Check Failure #0,The value of ESP was not properly saved 错误解决
- DLL 调用错误 -The value of ESP was not properly saved across a function call
- dynamic DLL 调用错误 -The value of ESP was not properly saved across a function call
- The value of ESP was not properly saved across a function call.
- The value of ESP was not properly saved across a function call.