Julian
April 20, 2007, 00:38:47
I would like to build a C++ project in Visual Studio 2005 with the .NET common language runtime (i.e. /clr switch on) so that I can mix C++ calls to the Imaging Control with .NET code. I tried building a project and then added the call to DShowLib::InitLibrary(key) to initialize your library but this call throws an exception. The same call runs fine in one of the sample C++ projects which does not use the CLR. Is that the reason for the difference? Is there a way to make this work with the CLR?
Julian
More details:
Error message:
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in MyApp.exe
Additional information: External component has thrown an exception.
Here's the callstack when the error is thrown:
kernel32.dll!7c812a5b()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
kernel32.dll!7c812a5b()
msvcr71d.dll!_CxxThrowException(void * pExceptionObject=0x0012db58, const _s__ThrowInfo * pThrowInfo=0x10188a80) + 0x39 bytes C++
TIS_DShowLib07_vc71d.dll!100e546e()
TIS_DShowLib07_vc71d.dll!100e55eb()
TIS_DShowLib07_vc71d.dll!100e52a2()
TIS_DShowLib07_vc71d.dll!1008158f()
msvcr71d.dll!_CallSettingFrame(unsigned long funclet=1241096, unsigned long pRN=256, unsigned long dwInCode=57244) + 0x27 bytes Asm
msvcr71d.dll!_CallCatchBlock2(EHRegistrationNode * pRN=0x0012f008, const _s_FuncInfo * pFuncInfo=0x1018350c, void * handlerAddress=0x100814ba, int CatchDepth=0, unsigned long NLGCode=256) + 0x54 bytes C++
msvcr71d.dll!CallCatchBlock(EHExceptionRecord * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, _CONTEXT * pContext=0x0012e210, const _s_FuncInfo * pFuncInfo=0x1018350c, void * handlerAddress=0x100814ba, int CatchDepth=0, unsigned long NLGCode=256) + 0xab bytes C++
msvcr71d.dll!CatchIt(EHExceptionRecord * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, _CONTEXT * pContext=0x0012e210, void * pDC=0x0012e1c4, const _s_FuncInfo * pFuncInfo=0x1018350c, const _s_HandlerType * pCatch=0x101834e8, const _s_CatchableType * pConv=0x10188a2c, const _s_TryBlockMapEntry * pEntry=0x101834f8, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000, unsigned char IsRethrow=0) + 0x9a bytes C++
msvcr71d.dll!FindHandler(EHExceptionRecord * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, _CONTEXT * pContext=0x0012e210, void * pDC=0x0012e1c4, const _s_FuncInfo * pFuncInfo=0x1018350c, unsigned char recursive=0, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000) + 0x23b bytes C++
msvcr71d.dll!__InternalCxxFrameHandler(EHException Record * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, _CONTEXT * pContext=0x0012e210, void * pDC=0x0012e1c4, const _s_FuncInfo * pFuncInfo=0x1018350c, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000, unsigned char recursive=0) + 0xe4 bytes C++
msvcr71d.dll!__CxxFrameHandler(EHExceptionRecord * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, void * pContext=0x0012e210, void * pDC=0x0012e1c4) + 0x2c bytes C++
ntdll.dll!7c9037bf()
ntdll.dll!7c90378b()
ntdll.dll!7c937860()
ntdll.dll!7c949b34()
ntdll.dll!7c926a44()
ntdll.dll!7c926abe()
ntdll.dll!7c90eafa()
kernel32.dll!7c812a5b()
kernel32.dll!7c812a5b()
ntdll.dll!7c919b3f()
ntdll.dll!7c919aeb()
ntdll.dll!7c919b3f()
ntdll.dll!7c919aeb()
ntdll.dll!7c919d27()
kernel32.dll!7c812a5b()
> msvcr71d.dll!_CxxThrowException(void * pExceptionObject=0x0012e598, const _s__ThrowInfo * pThrowInfo=0x10188a80) + 0x39 bytes C++
TIS_DShowLib07_vc71d.dll!100e546e()
TIS_DShowLib07_vc71d.dll!100e5012()
TIS_DShowLib07_vc71d.dll!100e1665()
TIS_DShowLib07_vc71d.dll!1008146a()
TIS_DShowLib07_vc71d.dll!100a4f94()
TIS_UDSHL07_vc8d.dll!006e60f4()
TIS_UDSHL07_vc8d.dll!006e5f83()
TIS_UDSHL07_vc8d.dll!006e570d()
[External Code]
MyApp.exe!MyApp::Controller::Controller() Line 32 + 0xc bytes C++
MyApp.exe!main(array<System::String^> ^ args = {Length=0}) Line 16 + 0x13 bytes C++
ntdll.dll!7c926abe()
ntdll.dll!7c9268ad()
ntdll.dll!7c91056d()
kernel32.dll!7c80a027()
ntdll.dll!7c91056d()
TIS_UDSHL07_vc8d.dll!0065002e()
ntdll.dll!7c926abe()
ntdll.dll!7c9268ad()
ntdll.dll!7c91056d()
kernel32.dll!7c80261a()
kernel32.dll!7c8025f0()
mscoree.dll!7900837f()
TIS_UDSHL07_vc8d.dll!00730020()
TIS_UDSHL07_vc8d.dll!00750073()
TIS_UDSHL07_vc8d.dll!00730020()
TIS_UDSHL07_vc8d.dll!00750061()
ntdll.dll!7c9106eb()
ntdll.dll!7c9106eb()
mscoree.dll!79011b5f()
kernel32.dll!7c816fd7()
Julian
More details:
Error message:
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in MyApp.exe
Additional information: External component has thrown an exception.
Here's the callstack when the error is thrown:
kernel32.dll!7c812a5b()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
kernel32.dll!7c812a5b()
msvcr71d.dll!_CxxThrowException(void * pExceptionObject=0x0012db58, const _s__ThrowInfo * pThrowInfo=0x10188a80) + 0x39 bytes C++
TIS_DShowLib07_vc71d.dll!100e546e()
TIS_DShowLib07_vc71d.dll!100e55eb()
TIS_DShowLib07_vc71d.dll!100e52a2()
TIS_DShowLib07_vc71d.dll!1008158f()
msvcr71d.dll!_CallSettingFrame(unsigned long funclet=1241096, unsigned long pRN=256, unsigned long dwInCode=57244) + 0x27 bytes Asm
msvcr71d.dll!_CallCatchBlock2(EHRegistrationNode * pRN=0x0012f008, const _s_FuncInfo * pFuncInfo=0x1018350c, void * handlerAddress=0x100814ba, int CatchDepth=0, unsigned long NLGCode=256) + 0x54 bytes C++
msvcr71d.dll!CallCatchBlock(EHExceptionRecord * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, _CONTEXT * pContext=0x0012e210, const _s_FuncInfo * pFuncInfo=0x1018350c, void * handlerAddress=0x100814ba, int CatchDepth=0, unsigned long NLGCode=256) + 0xab bytes C++
msvcr71d.dll!CatchIt(EHExceptionRecord * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, _CONTEXT * pContext=0x0012e210, void * pDC=0x0012e1c4, const _s_FuncInfo * pFuncInfo=0x1018350c, const _s_HandlerType * pCatch=0x101834e8, const _s_CatchableType * pConv=0x10188a2c, const _s_TryBlockMapEntry * pEntry=0x101834f8, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000, unsigned char IsRethrow=0) + 0x9a bytes C++
msvcr71d.dll!FindHandler(EHExceptionRecord * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, _CONTEXT * pContext=0x0012e210, void * pDC=0x0012e1c4, const _s_FuncInfo * pFuncInfo=0x1018350c, unsigned char recursive=0, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000) + 0x23b bytes C++
msvcr71d.dll!__InternalCxxFrameHandler(EHException Record * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, _CONTEXT * pContext=0x0012e210, void * pDC=0x0012e1c4, const _s_FuncInfo * pFuncInfo=0x1018350c, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000, unsigned char recursive=0) + 0xe4 bytes C++
msvcr71d.dll!__CxxFrameHandler(EHExceptionRecord * pExcept=0x0012e1f0, EHRegistrationNode * pRN=0x0012f008, void * pContext=0x0012e210, void * pDC=0x0012e1c4) + 0x2c bytes C++
ntdll.dll!7c9037bf()
ntdll.dll!7c90378b()
ntdll.dll!7c937860()
ntdll.dll!7c949b34()
ntdll.dll!7c926a44()
ntdll.dll!7c926abe()
ntdll.dll!7c90eafa()
kernel32.dll!7c812a5b()
kernel32.dll!7c812a5b()
ntdll.dll!7c919b3f()
ntdll.dll!7c919aeb()
ntdll.dll!7c919b3f()
ntdll.dll!7c919aeb()
ntdll.dll!7c919d27()
kernel32.dll!7c812a5b()
> msvcr71d.dll!_CxxThrowException(void * pExceptionObject=0x0012e598, const _s__ThrowInfo * pThrowInfo=0x10188a80) + 0x39 bytes C++
TIS_DShowLib07_vc71d.dll!100e546e()
TIS_DShowLib07_vc71d.dll!100e5012()
TIS_DShowLib07_vc71d.dll!100e1665()
TIS_DShowLib07_vc71d.dll!1008146a()
TIS_DShowLib07_vc71d.dll!100a4f94()
TIS_UDSHL07_vc8d.dll!006e60f4()
TIS_UDSHL07_vc8d.dll!006e5f83()
TIS_UDSHL07_vc8d.dll!006e570d()
[External Code]
MyApp.exe!MyApp::Controller::Controller() Line 32 + 0xc bytes C++
MyApp.exe!main(array<System::String^> ^ args = {Length=0}) Line 16 + 0x13 bytes C++
ntdll.dll!7c926abe()
ntdll.dll!7c9268ad()
ntdll.dll!7c91056d()
kernel32.dll!7c80a027()
ntdll.dll!7c91056d()
TIS_UDSHL07_vc8d.dll!0065002e()
ntdll.dll!7c926abe()
ntdll.dll!7c9268ad()
ntdll.dll!7c91056d()
kernel32.dll!7c80261a()
kernel32.dll!7c8025f0()
mscoree.dll!7900837f()
TIS_UDSHL07_vc8d.dll!00730020()
TIS_UDSHL07_vc8d.dll!00750073()
TIS_UDSHL07_vc8d.dll!00730020()
TIS_UDSHL07_vc8d.dll!00750061()
ntdll.dll!7c9106eb()
ntdll.dll!7c9106eb()
mscoree.dll!79011b5f()
kernel32.dll!7c816fd7()