G
George Faraj
Hi, I have a .lib project and a WIN32 .exe project to test the
library. When I'm trying to debug this application, I see that the
debugger displays incorrect values to some variables. This causes
runtime errors in my code. Sometimes this happens, sometimes it
doesn't. I searched the Microsoft Knowledge Base and saw this article:
http://support.microsoft.com/default.aspx?scid=kb;en-
us;100773&Product=vcNET
But both of those projects have optimizations off. I am
clueless on how to solve this problem now.
More specifically, I see that this happens only to class member
variables, and not to function local variables.
Another thing I see (and which causes the runtime error I'm having) is
that class members that are vectors are messed up. After creating my
class, I check my vector's size using size() and it returns -13172,
and I call empty() and it returns false. It should be empty at this
time. The error occurs in the following code:
YControl* YContainer::GetFocusedControl()
{
if (!Controls.empty())
return Controls.back();
return 0;
}
Since empty() returns false, it calls back() and somewhere it goes
wrong and throws an access violation exception. This happens on a
Release version of the library and application too.
This is really weird. Anyone know what could be wrong?
I appreciate any help.
Thanks,
George Faraj
library. When I'm trying to debug this application, I see that the
debugger displays incorrect values to some variables. This causes
runtime errors in my code. Sometimes this happens, sometimes it
doesn't. I searched the Microsoft Knowledge Base and saw this article:
http://support.microsoft.com/default.aspx?scid=kb;en-
us;100773&Product=vcNET
But both of those projects have optimizations off. I am
clueless on how to solve this problem now.
More specifically, I see that this happens only to class member
variables, and not to function local variables.
Another thing I see (and which causes the runtime error I'm having) is
that class members that are vectors are messed up. After creating my
class, I check my vector's size using size() and it returns -13172,
and I call empty() and it returns false. It should be empty at this
time. The error occurs in the following code:
YControl* YContainer::GetFocusedControl()
{
if (!Controls.empty())
return Controls.back();
return 0;
}
Since empty() returns false, it calls back() and somewhere it goes
wrong and throws an access violation exception. This happens on a
Release version of the library and application too.
This is really weird. Anyone know what could be wrong?
I appreciate any help.
Thanks,
George Faraj