Visual studio Microsoft Visual Studio C运行时库在Mypro.exe中检测到致命错误

Visual studio Microsoft Visual Studio C运行时库在Mypro.exe中检测到致命错误,visual-studio,mfc,managed-c++,Visual Studio,Mfc,Managed C++,我有一个MCVC++2010 MFC项目,它使用4个函数访问第三方C DLL。 我在VisualStudio2010中的一个Win32项目中使DLL正常工作。但是当我把它集成到我的MFC项目中,它工作得非常好,我得到了这个结果 在我尝试从此DLL访问函数时,Microsoft Visual Studio C运行库检测到一个致命错误。我在调用堆栈或输出控制台中没有得到有用的信息。 就在函数调用之后,控件降落在debughook.c中, 在最末端_调试器_钩子_伪=0 dbghook.c 代码包含在

我有一个MCVC++2010 MFC项目,它使用4个函数访问第三方C DLL。 我在VisualStudio2010中的一个Win32项目中使DLL正常工作。但是当我把它集成到我的MFC项目中,它工作得非常好,我得到了这个结果

在我尝试从此DLL访问函数时,Microsoft Visual Studio C运行库检测到一个致命错误。我在调用堆栈或输出控制台中没有得到有用的信息。 就在函数调用之后,控件降落在debughook.c中, 在最末端_调试器_钩子_伪=0

dbghook.c

代码包含在try-catch中,但是当我尝试单步执行控件时,它永远不会到达catch块。没有明确的迹象表明问题在哪里。有什么建议吗

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;
}