S
Steve
I am experiencing the following:
I am using a static member variable of a class to track how many instances
of a class are in existence using MSVC 6 SP5. Access error occurs when I
try to run. I try to debug, but anytime that a function in this class is
called it vectors to an address in another loaded module. Say, I try to set
a breakpoint on the statement in the constructor. As soon as the debugger
tries to jump to the constructor, it instead jumps into an unknown spot in
another loaded variable. Compiler or debugger problem maybe? Any guesses or
workarounds? Thanks. Steve
SomeClass.h:
class SomeClass
{
private:
static USHORT m_ushCount;
};
And define \ initialize \ use it at file scope like this:
SomeClass.cpp:
USHORT SomeClass::m_ushCount = 0;
SomeClass::SomeClass()
{
m_ushCount++;
}
SomeClass::~SomeClass()
{
m_ushCount--;
if(m_ushCount == 0)
{
//delete some support stuff when there are no more instances of this
class
}
}
I am using a static member variable of a class to track how many instances
of a class are in existence using MSVC 6 SP5. Access error occurs when I
try to run. I try to debug, but anytime that a function in this class is
called it vectors to an address in another loaded module. Say, I try to set
a breakpoint on the statement in the constructor. As soon as the debugger
tries to jump to the constructor, it instead jumps into an unknown spot in
another loaded variable. Compiler or debugger problem maybe? Any guesses or
workarounds? Thanks. Steve
SomeClass.h:
class SomeClass
{
private:
static USHORT m_ushCount;
};
And define \ initialize \ use it at file scope like this:
SomeClass.cpp:
USHORT SomeClass::m_ushCount = 0;
SomeClass::SomeClass()
{
m_ushCount++;
}
SomeClass::~SomeClass()
{
m_ushCount--;
if(m_ushCount == 0)
{
//delete some support stuff when there are no more instances of this
class
}
}