Archived

This topic is now archived and is closed to further replies.

billybob

my program can read the future?

Recommended Posts

I am having an extremely strange crash, basically it looks like this: some code here, we''ll call it code 1 ... more code further down, we''ll call it code 2 if code 2 is commented, there is no crash, if its not commented, there is a crash in code 1. how is this possible, some kind of compiler glitch?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The first thing you should do is not to blame the compiler. Blame your code until you know otherwise.

If you need any help with your code, please post code instead of vague descriptions.

Share this post


Link to post
Share on other sites
I know its my code, it just doesn''t make sense.


if(!m_BrowserTabSheet.Create(m_Browser)) // this is what crashes if the code below is uncommented
ThrowError("CPropertySheet::Create Failed");

// a bunch of code here, too much to post. it couldn''t crash, at least i doubt it, its only setting a few pages and a bunch of GetClientRect and rect setup

m_BrowserTabSheet.SetActivePage(2);
RECT rcTexViewport;
::GetClientRect(m_BrowserTexture, &rcTexViewport);
rcTexViewport.top += 50;
rcTexViewport.bottom -= 70;
rcTexViewport.left += 10;
rcTexViewport.right -= 20;

// if i uncomment the following code, the m_BrowserTabSheet.Create crashes in that (ATL/WTL) function.
// m_TextureEditor.Create(::GetDlgItem(m_BrowserTexture, IDC_PROPERTIES));
// m_hTextureViewport.Create(ViewportClassName, this, BrowserMsgMap, m_BrowserTexture, &rcTexViewport, _T("Textures"), WS_CHILD | WS_VISIBLE);
// Render::GetInstance()->CreateViewport(&m_TextureViewport, m_hTextureViewport, 0, 0, FmtNone, false);

Share this post


Link to post
Share on other sites
yea, is that all in the same block of code, cause mayeb its not running in the order you think it is, put a break on the part that crashes when its uncomented and the part that u uncometn and see who gets hit first

Share this post


Link to post
Share on other sites
Are you sure the code isn''t being run more than once?

______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________

Share this post


Link to post
Share on other sites
quote:
Original post by antareus
Ever heard of a debugger?

yes, the entire call stack is NTDLL! except for the last one, which is a seemingly random sequence of letters and numbers and a !.

its not executing more than once

i simply reordered the sequence that i build the pages of the property sheet and it worked. i''d still like to know what happened though.

Share this post


Link to post
Share on other sites