1
我有一个服务应用程序在通过服务关闭时仅在一台PC(Windows XP)上崩溃。OLE32关闭我的服务时出现异常
我得到的WinDbg以下错误:
(1038.728): Access violation - code c0000005 (!!! second chance !!!)
eax=00000000 ebx=00000000 ecx=0018b7a4 edx=77606e00 esi=0016b7f8 edi=0018b7a4
eip=7750cdbd esp=0012fe78 ebp=0012fe84 iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
...
ole32!StringFromCLSID+0x325
ole32!StringFromCLSID+0x2e7
ole32!StringFromCLSID+0x2c9
ole32!StringFromCLSID+0x215
ole32!StringFromCLSID+0x38f
RPCRT4!IUnknown_Release_Proxy+0x11
mfc100+0x20a229
MSVCR100!exit+0x11
我的代码使用某种形式的COM/OLE数据库控制和访问它是这样的:
CoInitializeEx(0, COINIT_MULTITHREADED);
IClientTable testCDS;
testCDS.CreateDispatch("ClientTableServer.ClientTable");
testCDS.ReleaseDispatch();
<Windows message loop>
CoUninitialize();
如果我注释掉使用testCDS,没有崩溃。我尝试过ReleaseDispatch和DetachDispatch的组合,但我仍然遇到同样的问题。
帮助将不胜感激。 谢谢
什么是IClientTable的类型? – sharptooth
对不起下面的格式,但我似乎无法对其进行编辑的代码类IClientTable:公众的COleDispatchDriver { 市民: \t IClientTable(){} \t \t //调用的COleDispatchDriver默认构造函数 \t IClientTable(LPDISPATCH pDispatch): COleDispatchDriver(pDispatch){} \t IClientTable(const IClientTable&dispatchSrc):COleDispatchDriver(dispatchSrc){} – SparkyNZ