Original Post
hi,
I''m having a rather odd problem with DirectX9 / C++.Net - I keep getting an exception from a piece of code and I cant find out how/why!
I''ve done my utmost best to debug it - but even VStudio.Net isn''t being that helpful - the exception ("user breakpoint") breaks straight to dissasembly and the call stack just has the current (error) line and a previous line in dissasembly... I cant work out which line in my actual source code generates the error.
However, by commenting out diff. lines I can find out roughly whats wrong. So I stick it in a try...catch block (to stop the unhandled exception), and it''s still thrown!! I dont get that!
Here''s my code:
Basically, I''m trying to get D3D9 to draw some text to the screen including the frame rate info.
i specifically DONT want to use the SDK frameworks, hence I''m using my own code
drawing text works fine - the fonts exist okay, I can replace param-1 in the DrawTextA() line above with "Hello" and it''ll print just fine.
any hints!?!
cheers
Jack
try {
LPRECT x = new RECT;
x->top = 5;
x->left = 5;
x->bottom = 20;
x->right = 200;
char *pMsg = "blah";
//pMsg = new char;
//if (fCurrFPS < 10)
// fCurrFPS = -3.14159;
//sprintf( pMsg, "Current Frame Rate: %d", (int)fCurrFPS );
lpFont->DrawTextA(pMsg,-1, x, DT_TOP|DT_LEFT, D3DCOLOR_XRGB(255,0,0) );
//delete pMsg;
} catch ( ... ) {
MessageBox(NULL, "EXCEPTION CAUGHT!!!!","Error",MB_OK);
}