Sign in to follow this  
gav86

Mysterious Quit

Recommended Posts

OK well I was just writing up the beginnings of a program, just made a simple "clear screen to blue" for the time being. Anyway it worked fine, so I went to add a function for loading/displaying 2d images, which I screwed up (made it overcomplicated). I deleted all that stuff so the program was back to how it was before - just clear the screen to blue. It compiles fine but now when I run it it quits upon entering winmain. . . I ran the VC++6 debug and here is the output from that:
Quote:
Loaded 'ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\d3d9.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\d3d8thk.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\winmm.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\mslbui.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\oleaut32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found. The thread 0xE0 has exited with code 0 (0x0). The program 'C:\programming\cpp\DX\3DTest\Debug\3DTest.exe' has exited with code 0 (0x0).
Can someone tell me what on earth is going on!

Share this post


Link to post
Share on other sites
The "no matching symbolic information found" messages just mean that you don't have the necessary info to debug into those system files. It's very unlikely they have anything to do with your problem.

I don't know why your program exited.

Share this post


Link to post
Share on other sites
Do you have some kind of event loop and are you sure you enter it ? Sounds like the program is terminating prematurely to me.

Edit: Wow, that's what I call a tautology. I'll leave it here for future reference. [grin]

Share this post


Link to post
Share on other sites
Ive isolated the problem down to this area...

	wndHandle = CreateWindow("3DTest", 
"3DTest",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
800,
600,
NULL,
NULL,
hInstance,
NULL);
if (!wndHandle)
{
MessageBox(NULL, "!wndHandle", "message", MB_OK);
return false;
}


!wndHandle is true, which is causing the program to quit just after winmain() is entered.

HWND wndHandle is a global variable defined at the start of the file...

Share this post


Link to post
Share on other sites
I've encountered some incidents where a CRT assertion triggers, but instead of actually popping up an assertion dialog box, the CRT simply forced the app to exit when the assert failed.

As for finding the actual assertion? Good freaking luck. I usually resort to progressive elimination, commenting things until the app exits normally.

Share this post


Link to post
Share on other sites
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}


Here is WndProc!

Can someone tell me how I might go about outputting GetLastError() . . to say a messagebox?

Share this post


Link to post
Share on other sites
Ok, the WindowProc isn't at fault. You could use the debugger to get the value of GetLastError(). Just assign it to a variable and look at it in the watch window.

Another shot in the dark:
Is RegisterClass still being used? Maybe the class stuff got axed as well.

Share this post


Link to post
Share on other sites
I agree with Endurion, that you've probably deleted your RegisterClass(Ex) or modified it incorrectly, since your CreateWindowEx call seems correct. It should be before your CreateWindowEx and should be creating a window class called "3DTest".

tj963

Share this post


Link to post
Share on other sites
you mean this bit?

	WNDCLASSEX wcex;

wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = 0;
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = "3DTest";
wcex.hIconSm = 0;
RegisterClassEx(&wcex);


Also i'm not sure by what you mean with "watch window" in relation to debugger..

Share this post


Link to post
Share on other sites
hi. my guess is you forgot to include some library into your program, or you dont' use the proper CRT libraries for your application. I've seen this kind of output so many times.... :D

Share this post


Link to post
Share on other sites
all libraries are included as the file worked previously with no change to the include section (as mentioned earlier i added some extra stuff which i then removed, but no change to inclusions).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this