debuging

Started by
2 comments, last by wingman20 23 years ago
hi, htere is s problem somewhere in my app, i would like to be able to just debug like i would if it were an app, but there are calls to getDC and other functions that make debuging impossible. What can i do to track down my bug. thanks
Advertisement
I''m confused as to why a call to GetDC() would cause problems for your debugging session. Running graphics in exlusive mode would, but...

What compiler are you using?

If you are running in exclusive mode, I usually use PlaySound to find where I''m crashing (if it beeps before it fatals, I know that the crash is somewhere after that... makes it easy to narrow down the bug''s location.)

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
the reason that GetDC is screwing up debugging is that while i''m debugging it, it gets the DC of MSVC and it stops redrawing the screen because ReleaseDC has not been called. I cannot see what is happening, so i can''t debug.

The PlaySound is a really good idea, don''t know why i didn''t think of it, i used to use AfxMessageBox, when i programmed apps for the same purose.

thanks
They say you can debug fullscreen exclusive apps with either two monitors or over an ipx network connection. Since I dont have any, I can only dream

Anyways, this is what I''m using for my project. I dont really understand exceptions, but when they happen the program doesnt just exit, it exits exclusive mode (DebugKillDDraw ()) and gives me the exception address. I throw the address in the exception wizard (http://members.aol.com/ExceptWiz/index.html) and voila : the exact place where the code crashed

And I can always put a breakpoint in that __except block and see my data.

I also use lots of asserts that on failure call DebugKillDDraw and then go into a breakpoint and let me look at the data.

Maybe you could use a similar approach with your DC problems, only instead of DebugKillDDraw, you might have a DebugReleaseBuggyDC function.

I can guess this is pretty obsolette stuff, but it helped me alot..

//global varsint EXaddress;int EXcode;BOOL MyFilter(LPEXCEPTION_POINTERS expepo){	EXcode=expepo->ExceptionRecord->ExceptionCode;	EXaddress=(int)expepo->ExceptionRecord->ExceptionAddress;	return TRUE;}int PASCALWinMain(HINSTANCE hInstance,        HINSTANCE hPrevInstance,        LPSTR lpCmdLine,        int nCmdShow){// ............... 	__try {	//	main game loop	}	__except (MyFilter(GetExceptionInformation()))	{		DebugKillDDraw(); // stops exclusive mode		char buf[550];		sprintf(buf,"code = %d  address = 0x%Xh",EXcode,EXaddress);		MessageBox(NULL,buf,"exception",MB_YESNO);		return 0;	}} 

This topic is closed to new replies.

Advertisement