unhandled exception CreateWindow()

Started by
7 comments, last by Buckeye 9 years, 12 months ago

It doesn't matter which directx 10 sample of the 2010 Directx SDK I try to run in debugging mode on visual studio 2013 or 2010 or 2012, I always get an unhandled exception on the CreateWindow() function

I didn't get this exception before and I don't know how it started

anyone with this problem too?

Advertisement

Could you post the exception ?

running the RaycastTerrain sample in the directx 10 samples

First-chance exception at 0x1000238E (DestructionView.dll) in RaycastTerrain.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x1000238E (DestructionView.dll) in RaycastTerrain.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x1000238E (DestructionView.dll) in RaycastTerrain.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x73374D66 in RaycastTerrain.exe: 0xC0000005: Access violation reading location 0x00000010.
*** An Access Violation occurred in "F:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\Direct3D10\RaycastTerrain\Debug\RaycastTerrain.exe" :
The instruction at 0000000073374D66 tried to read from an invalid address, 0000000000000010
*** enter .exr 000000000024B9B0 for the exception record
*** enter .cxr 000000000024B4C0 for the context
*** then kb to get the faulting stack
Unhandled exception at 0x73374D66 in RaycastTerrain.exe: 0xC000041D: An unhandled exception was encountered during a user callback.

and this is the line that is the same no matter which sample I run

HWND hWnd = CreateWindow( L"Direct3DWindowClass", strWindowTitle, WS_OVERLAPPEDWINDOW,
x, y, ( rc.right - rc.left ), ( rc.bottom - rc.top ), 0, hMenu, hInstance, 0 );

You are passing a pointer somewhere that is 0 and shouldnt be zero. This 0xC0000005: Access violation writing location 0x00000000 exception always means you are trying to write to something through a pointer that has value 0.

I expect either strWindowTitle, hMenu or hInstance to be 0.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

but I haven't modified those samples, and as I said no matter which random sample I select, It allways gets that exception

You are passing a pointer somewhere that is 0 and shouldnt be zero. This 0xC0000005: Access violation writing location 0x00000000 exception always means you are trying to write to something through a pointer that has value 0.

I expect either strWindowTitle, hMenu or hInstance to be 0.


Actually, considering the text

Unhandled exception at 0x73374D66 in RaycastTerrain.exe: 0xC000041D: An unhandled exception was encountered during a user callback.


I would be more inclined to believe the window procedure is null or does something with something null.

Although the last error occurs during the execution of the CreateWindow function, that may just be the culmination of the previous errors. I.e., something else may be getting trashed before that line.

I would start by looking at the exceptions before that line.

E.g., googling indicates DestructionView.dll is a part of NVIDIA PhysX. That library looks suspicious to be part of an SDK example. Have you been working with that library before? Driver libraries do get loaded, but I would look at those errors before worrying about a CreateWindow function.

I don't know what IDE you're working in (Visual Studio?), but (just a guess) it appears that you may be loading a foreign (foreign to the example) library for some reason. When you start the app, your output window (or debug window) should be displaying lots of information about what libraries are being loaded. Take a look through that info for dlls, etc., that don't come from Windows or the SDK directories. EDIT: don't worry about "Cannot find or open the PDB file" - that's just an indication that debug builds for those libraries aren't available.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

I solved the problem
there is this folder named F:\Users\AppData\Local\Owfics which has two files, one is DestructionView.dll and the other is DestructionView.2
when I run a sample in debig mode the last loaded line loads that DestructionView.dll and from there the errors start
I tried deleting that folder but it said that it was being used by a program, then I made myself sure that there was no program running and then tried deleteng it and it said the same, so I rename the folder and the files then restarted my computer and the first message that appears in my screen is this error message
RegSvr32
The module F:\Users\AppData\Local\Owfics\DestructionView.dll failed to load
Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.
The specified module could not be found.
I pressed ok to the message
Then I opened a random sample to run it in debug mode and IT WORKED!!!
the last loaded lines no longer is a load to DestructionView.dll
but now every time I turn on my PC the RegSvr32 error message appears

FYI - as mentioned, it appears that destructionview.dll is an NVIDIA Physx Lab file. You didn't mention whether you'd ever played around with Physx.

If you can verify for yourself that you don't need that dll running, you may want to take a look at some RegSrvr32 info. Just for fun, you may want to scan the files with your antivirus program - just in case.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

This topic is closed to new replies.

Advertisement