ExecutionEngineException and access violation

  • Thread starter Thread starter Thomas Albrecht
  • Start date Start date
T

Thomas Albrecht

My application fails during initialization of the dlls
with an ExecutionEngineException and a access violation in
the MFC app. The structure of the program looks like:

MFC app -> mixed DLL -> managed DLL (C#)

Because the exception/access violation occures during
startup none of my breakpoints are reached.

I disabled the access to the DLL step by step and
recognized that a statement in the OnInitDialog causes the
problem. Unfortunately it is the creation of the object
which (unmanaged) class is stored inside the mixed DLL.

The statement is really simple:
m_pUnmanagedSocket = new CUnmanagedSocket();

The CUnmanagedSocket accesses a managed class internally.

BTW the OnInitDialog method is never called before the
execution stops.

I tried the /NOENTRY flag but without success. Could it be
a problem that the mixed DLL is statically linked?

I really appreciate any help, hints or comments on this
topic because at the moment I simply have no idea how to
solve this problem.

Thanks in advance

Thomas
 
Thomas Albrecht said:
My application fails during initialization of the dlls
with an ExecutionEngineException and a access violation in
the MFC app. The structure of the program looks like:

MFC app -> mixed DLL -> managed DLL (C#)

Because the exception/access violation occures during
startup none of my breakpoints are reached.

If you run your app under WinDbg [http://www.microsoft.com/ddk/debugging/]
you can catch access violations and similar during startup.
I have used this technique to sort out an access violation with loading a
mix of DbgHelp and ImageHlp in the same process.

Roger Orr
 
Back
Top