Howdy
I''ve come across a bizarre problem (or at least I think it is)
![](smile.gif)
. I have the following code in my WinMain function:
while (1)
{
if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
break;
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
else
{
if (CConsole::GetInstance().NeedToDraw())
{
CConsole::GetInstance().Draw();
}
CScreen::GetInstance().Flip();
}
}
|
Looks alright to me, but when I run it, my computer freezes. The weird thing is, when I debug it, either using step into or step over, it works perfectly fine!
However, to further complicate things...The CScreen::Flip() method returns a bool, which I have as a typdef''d int (i''m using VC++ 4.0, so there''s no built-in support). When I step into the method, and step all the way through it, it returns 1 (true) as expected, but when I step over it, it returns four hundred thousand and some. What''s up with that?
Also, my CConsole class...when I step into the Draw function, the this pointer is pointing to four bytes after the actual start of the console object. What I mean is &CScreen::m_instance will be something like 0x00421358 and the this pointer inside the method will be 0x0042135c! None of my other singleton objects do this, and I suspect it has something to do with the CConsole class'' multiple inheritance.
Anyway, sorry this is so long, but if anybody knows what could be causing any of these things, please let me know!
![](smile.gif)
Thanks,
Scott