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++ / January 2005

Tip: Looking for answers? Try searching our database.

Yet another debug-to-release issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jlea - 27 Jan 2005 20:59 GMT
How many times have we had a program that works toot-sweet in debug but dies
in release? Too many.

I've created .NET assembly containing a bunch of managed wrapper C++ classes
that wrap unmanged C++ classes; these unmanaged C++ classes are located in a
Win32 library file. The library is built using MFC as shared in debug but
static in release (this is how we typically to things).

The managed wrapper classes do a new on the unmanged class in the
constructor and then have pass through functions to the unmanaged class.

I have a console application that tests the wrapper assembly and all is
heavenly sweet in debug.

In release mode, the heap is corrupted before any lines are executed in the
constructor of any managed wrapper class; it is fine in the test application
right before it does a new on the managed wrapper class. _crtheap is zero in
malloc.c.

Anyone have any ideas?

Thanks.

Jon.
Ramsey - 28 Jan 2005 00:32 GMT
I don't know how much this helps but I'm curious what would happen if
MFC library is statically linked in debug mode.

Without seeing any project settings, that seems the only difference
between debug mode and release mode.

Keep us updated.

Ramsey
jlea - 28 Jan 2005 18:14 GMT
I gave this some thought and will probably give this a shot in my next go at
it - Thanks for the reply.

> I don't know how much this helps but I'm curious what would happen if
> MFC library is statically linked in debug mode.
[quoted text clipped - 5 lines]
>
> Ramsey
jlea - 31 Jan 2005 22:48 GMT
I got everything to play together by setting Use MFC as a Shared DLL and
using /MD throughout on all the components that go into building the .NET
assembly. I'd rather use Use MFC as a Static Library but perhaps creating a
DLL assembly with MFC requires the Shared version of MFC. It seems to work
so I'm moving on. Thanks all for the comments. Jon.

> I gave this some thought and will probably give this a shot in my next go at
> it - Thanks for the reply.
[quoted text clipped - 8 lines]
> >
> > Ramsey
Oleg Starodumov - 28 Jan 2005 11:12 GMT
It looks like CRT is not initialized.

May be here you can find some related information:
http://support.microsoft.com/?id=814472

Regards,
Oleg
jlea - 28 Jan 2005 18:20 GMT
Looks interesting - might have to give this a try - thanks. Jon.

> It looks like CRT is not initialized.
>
[quoted text clipped - 3 lines]
> Regards,
> Oleg

Rate this thread:







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.