> not. This is why release version act different when running without
> debugging.
It also gives some tips how can heap corruption be detected and debugged.
> 2. It workd fine in release version when ruuning after "Start
> Bebugging" menu selection.
> 3. When running the release version after "Start Without Bebugging",
> 95% of my program workds fine but it refuse to enter one of a class
> memeber funtion!
One low-level difference which comes to mind mind between those two is
the heap manager in ntdll.dll is checkin for the debugger and acts
slightly differently depending on whether the debugger is present or
not. This is why release version act different when running without
debugging.
My crystal ball guess is you are experiencing some subtle heap
corruption (strangled pointer, or perhaps a buffer overrun) somewhere in
your code.
> Problem solved after changing /MT to /MTd. I don't know why and if it
> is good to do so. But At least, it works!
If my crystall ball is right, the fix above is very dangerous, as it
only hides the problem (most likely by allocating a little but more
memory for each object, which "fixed" the buffer overun), but it may hit
you anytime later. As usual - it will be some inconvenient time like a
day before you ship, or the day some important customer will test your
application ;)
Cheers
Ondrej
hill_y...@hotmail.com napsal(a):
Same question has been asked here several years ago but I still got
not much help from its anwsers.
My project is MFC build in VS2005. The program is:
1. It works fine in bebug version.
2. It workd fine in release version when ruuning after "Start
Bebugging" menu selection.
3. When running the release version after "Start Without Bebugging",
95% of my program workds fine but it refuse to enter one of a class
memeber funtion!
My checking code is something like:
class A
{
void dosomething()
{
::AfxMessageBox( L"entering A", MB_ICONWARNING );
}
};
class B
{
void dosomething()
{
A a;
::AfxMessageBox( L"entering B", MB_ICONWARNING );
}
};
I can get "entering B" message but fails to get "enetering A"!.
Any suggestion about this problem? Thanks in advance.- $B0zMQ%F%-%9%H$rI=<($7$J$$(B -