2

我有一个MCVC++ 2010MFC 项目,它访问具有 4functions 的第三方 C DLL。我让 DLL 在 Visual Studio 2010 中的 Win32 项目中运行良好。但是当我将它集成到运行良好的 MFC 项目中时,我得到了这个

"Microsoft Visual Studio C Runtime Library has detected a fatal error"我尝试从此 DLL 访问函数的那一刻。我在调用堆栈或输出控制台中没有得到任何有用的信息。就在函数调用之后,控制权落在 debughook.c 中,最后_debugger_hook_dummy = 0;

数据库钩子

int __cdecl _CrtDefaultAllocHook(int nAllocType,void * pvData, size_t nSize,int nBlockUse, long lRequest,const unsigned char * szFileName, int nLine )
{
return 1; /* allow all allocs/reallocs/frees */
}

#endif  /* _DEBUG */

int _debugger_hook_dummy;

#ifdef _M_IA64
#undef _CRT_DEBUGGER_HOOK
#define _CRT_DEBUGGER_HOOK __crt_debugger_hook
#endif  /* _M_IA64 */

__declspec(noinline)
void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved)
{
    /* assign 0 to _debugger_hook_dummy so that the function is not folded in retail */
    (_Reserved);
    _debugger_hook_dummy = 0;
}

代码包含在 中try-catch,但是当我尝试介入时,控件永远不会到达 catch 块。没有明确的迹象表明问题出在哪里。任何指针?

4

0 回答 0