Hello people,
I have tried to follow some articles about that will get you started into DirectX C++ (
http://www.devmaster.net/articles/intro-to-c++-with-game-dev/part1.php), and as far as understanding what they're doing code-wise everything goes well. But I'm having trouble running the template code from
http://www.devmaster.net/articles/intro-to-c++-with-game-dev/part2.php (article 2).
Whenever I try to run the code, it's executed (I think) up to a certain point. All I get is a console window saying "application started". Then after a few seconds, I get this error:
Unhandled exception at 0x00415f07 in Template_debug.exe: 0xC0000005: Access violation reading location 0x00000010. |
The code-window shows a yellow arrow at line 198 in the file template.cpp. (You can download the entire template, which ofcourse includes template.cpp, from the articles or through this link here:
http://www.devmaster.net/articles/intro-to-c++-with-game-dev/devmaster_intro-to-c++-tmpl83.00c_oct14.zip
Also, for some reason VS is poking around in folders that don't have anything to do with VS itself I think. It's looking in folders that belong to a pen-tablet :S
Here's the output window so you can see what I mean, I added two lines to indicate which part shows that it's looking in weird folders. It's between the
FROM HERE
and
TO HERE
lines.(I use Microsoft Visual Studio 2008 (Professional Edition) by the way)
'Template_debug.exe': Loaded 'C:\Documents and Settings\Username\My Documents\Visual Studio 2008\Projects\template\Template_debug.exe', Symbols loaded.
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
'Template_debug.exe': Loaded 'C:\Documents and Settings\Username\My Documents\Visual Studio 2008\Projects\template\SDL.dll', Binary was not built with debug information.
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\msimg32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\user32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\winmm.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\secur32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\ole32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\glu32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll'
'Template_debug.exe': Loaded 'C:\Documents and Settings\Username\My Documents\Visual Studio 2008\Projects\template\FreeImage.dll', Binary was not built with debug information.
'Template_debug.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\msvcr90d.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\msvcp90d.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\imm32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\d3d9.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\d3d8thk.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\version.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\WinTab32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll'
'Template_debug.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll'
------------FROM HERE------------
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::SetIpcDriver: at 46780484
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::SetIpcDriver: at 46780484
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::SetIpcHandler: at 46780484
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::Connect: at 46780484
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::Disconnect: at 46780484
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::Disconnected: at 46780484
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::SetIpcHandler: at 46780484
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::Disconnected: at 46780484
LaunchApp() Started at: 46781984
LaunchApp() Failed(D:\Program Files\GTCO CalComp\TabletWorks\WTServerCC.exe) at: 46781984
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::SetIpcDriver: at 46782093
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::SetIpcDriver: at 46782093
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::SetIpcHandler: at 46782093
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::Connect: at 46782093
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::Disconnect: at 46782093
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::Disconnected: at 46782093
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::SetIpcHandler: at 46782093
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::Disconnected: at 46782093
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::SetIpcDriver: at 46782109
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::SetIpcDriver: at 46782109
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::SetIpcHandler: at 46782109
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::Connect: at 46782109
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::Disconnect: at 46782109
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::Disconnected: at 46782109
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::SetIpcHandler: at 46782109
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::Disconnected: at 46782109
LaunchApp() Started at: 46783609
LaunchApp() Failed(D:\Program Files\GTCO CalComp\TabletWorks\WTServerCC.exe) at: 46783609
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::SetIpcDriver: at 46783718
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::SetIpcDriver: at 46783718
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::SetIpcHandler: at 46783718
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::Connect: at 46783718
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcHandler::Disconnect: at 46783718
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::Disconnected: at 46783718
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::SetIpcHandler: at 46783718
\Projects\TabletWorks\Wintab\WTCommon\Ipc.cpp::CCIpcDriver::Disconnected: at 46783718
------------TO HERE------------
First-chance exception at 0x00415f07 in Template_debug.exe: 0xC0000005: Access violation reading location 0x00000010.
Unhandled exception at 0x00415f07 in Template_debug.exe: 0xC0000005: Access violation reading location 0x00000010.
First-chance exception at 0x00415f07 in Template_debug.exe: 0xC0000005: Access violation reading location 0x00000010.
Unhandled exception at 0x00415f07 in Template_debug.exe: 0xC0000005: Access violation reading location 0x00000010.
First-chance exception at 0x00415f07 in Template_debug.exe: 0xC0000005: Access violation reading location 0x00000010.
The thread 'Win32 Thread' (0x1120) has exited with code -1073741510 (0xc000013a).
The thread 'Main Thread' (0x13f0) has exited with code -1073741510 (0xc000013a).
The program '[4388] Template_debug.exe: Native' has exited with code -1073741510 (0xc000013a). |
EDIT: The line that is giving me this error (line 198, like I said above) is this:
surface = new Surface( SCRWIDTH, SCRHEIGHT, (Pixel*)s->pixels, s->pitch );