Access Violation When Starting Your Own C ++ Application That Uses the Built-in DLL

I will reorganize the inherited mixed (managed and unmanaged DLL) application, so that the main segment of the application is unmanaged MFC, and this will call the C ++ DLL compiled with the / clr flag, which will link the relationship between the managed (C # DLL) and the unmanaged code. Unfortunately, my changes led to an access violation that occurs before calling the InitInstance () application. This makes debugging very difficult. The only information I get is the following stack trace.

>   64006108()  
ntdll.dll!_ZwCreateMutant@16()  + 0xc bytes 
kernel32.dll!_CreateMutexW@12()  + 0x7a bytes   

So, here are some sceanrios I've tried.
- Enabled Exceptions-> Win32 Exceptions-> c0000005 Access violation for a break during a throw. However, the biggest detail I get is related to the previous stack trace. I tried the application with F10, but it fails before all breakpoints are removed and fail with the stack trace above.

- I deleted the bridge DLL, so it has only one method that returns bool, and this method is encoded to just return false (C # code was not called).

bool DllPassthrough::IsFailed() { return false; }

DLL /clr, . /clr, .

- MFC-, Visual Studio DllPassthrough:: IsFailed(). /clr, DLL.

- LoadLibrary winmm.lib, ++/cli. .

, - ? , . , , , ? , , LoadLibrary, .

. BTW, Visual Studio 2008, .NET 2.0 .

+3
1

, . (), . , , , . , - , .
, - DLL. BTW, winmm.lib , .

+4

Source: https://habr.com/ru/post/1741279/


All Articles