Crash on target PC (not dev PC) when hosting a WinFormsView in a CFrameWnd?

D

Duncan Smith

Hi All,

Grateful if anyone has any suggestions here? I have a VS2005 MFC app
which hosts several types of views in CFrameWnds - one of which
contains a managed control hosted in a CWinFormsView

Everything works well on my dev pc (and other peoples dev pcs), but
when I try and instantiate the managed view on a target-pc (no
compilers, etc) there's an exception thrown followed by program
termination.

Compiling the release build with debug info and optimizations turned
off, I can trace the source of the crash to this line using WndBg

CView *pNewView = pFrame->CreateView(pInfo->m_pszTitle, pInfo-
m_pViewClass,
pInfo->m_uViewAccelerators);

m_pViewClass is just RUNTIME_CLASS(CWFVMessageView) which is the
CWinFormsView class. When I step over this line there's a first
chance exception 0x80000003 thrown (bad params?) way down in nt.dll

Both PCs have .NET v.2.0.50727 installed and vcredist_x86.exe has been
applied to the target PC? The managed control resides in a dll in the
same folder as the app module (not registered in the GAC or anything).

Like I say, it works well on a dev-pc but not a clean one, so maybe
I've missed a step out in the installer or something???

Many thanks,

Duncan.
 
D

Duncan Smith

Hi All,

Grateful if anyone has any suggestions here? I have a VS2005 MFC app
which hosts several types of views in CFrameWnds - one of which
contains a managed control hosted in a CWinFormsView

Everything works well on my dev pc (and other peoples dev pcs), but
when I try and instantiate the managed view on a target-pc (no
compilers, etc) there's an exception thrown followed by program
termination.

Compiling the release build with debug info and optimizations turned
off, I can trace the source of the crash to this line using WndBg

CView *pNewView = pFrame->CreateView(pInfo->m_pszTitle, pInfo->m_pViewClass,

pInfo->m_uViewAccelerators);

m_pViewClass is just RUNTIME_CLASS(CWFVMessageView) which is the
CWinFormsView class. When I step over this line there's a first
chance exception 0x80000003 thrown (bad params?) way down in nt.dll

Both PCs have .NET v.2.0.50727 installed and vcredist_x86.exe has been
applied to the target PC? The managed control resides in a dll in the
same folder as the app module (not registered in the GAC or anything).

Like I say, it works well on a dev-pc but not a clean one, so maybe
I've missed a step out in the installer or something???

Many thanks,

Duncan.

Found the problem: If you derive a class from CWinFormsView then your
app will require 'mfcmifc80.dll' at runtime, but this file does not
get shipped with vcredist_x86.exe so the onus is on your installer.

It was difficult to spot, because no information is given and even
WinDbg can't debug the managed module. In the end I hooked up a dev-
laptop to a release machine for a remote debug session - and finally
got a sensible error message.

It's a shame about WinDbg though because I won't always have a dev-pc
handy in the release environment. Oh well.

Regards,

Duncan.
 
Top