Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Duncan Smith - 30 Apr 2007 22:25 GMT
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.
Duncan Smith - 01 May 2007 14:22 GMT
> Hi All,
>
[quoted text clipped - 28 lines]
>
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.