I am currently trying to learn some directX programming and thus I am following this tutorial I found. After completing the first stage I should be able to get a blue window when I run the program, but instead I get no less then 103 Errors. After looking through the code and searching on the web for awhile I decided to ask if anyone her could enlighten me of what I've done so terribly wrong.
Here is my code:
Expand|Select|Wrap|Line Numbers
- #include <windows.h>
- #include <d3d9.h>
- // globals
- LPDIRECT3D9 g_pDirect3D = NULL;
- LPDIRECT3DDEVICE9 g_pDirect3D_Device = NULL;
- LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nShow)
- {
- MSG msg;
- WNDCLASSEX wc = {sizeof(WNDCLASSEX), CS_VREDRAW|CS_HREDRAW|CS_OWNDC,
- WndProc, 0, 0, hInstance, NULL, NULL, (HBRUSH)(COLOR_WINDOW+1),
- NULL, "DX9_TUTORIAL1_CLASS", NULL};
- RegisterClassEx(&wc);
- HWND hMainWnd = CreateWindow("DX9_TUTORIAL1_CLASS",
- "DirectX 9 Bare Bones Tutorial 1",
- WS_OVERLAPPEDWINDOW, 100, 100, 300, 300,
- NULL, NULL, hInstance, NULL);
- g_pDirect3D = Direct3DCreate9(D3D_SDK_VERSION);
- D3DPRESENT_PARAMETERS PresentParams;
- memset(&PresentParams, 0, sizeof(D3DPRESENT_PARAMETERS));
- PresentParams.Windowed = TRUE;
- PresentParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
- g_pDirect3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hMainWnd,
- D3DCREATE_SOFTWARE_VERTEXPROCESSING, &PresentParams,
- &g_pDirect3D_Device);
- ShowWindow(hMainWnd, nShow);
- UpdateWindow(hMainWnd);
- while(GetMessage(&msg, NULL, 0, 0))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- g_pDirect3D_Device->Release();
- g_pDirect3D->Release();
- return(0);
- }
- LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- switch(msg)
- {
- case WM_DESTROY:
- PostQuitMessage(0);
- return(0);
- case WM_PAINT: // <— ADD THIS BLOCK
- g_pDirect3D_Device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 255),
- 1.0f, 0);
- g_pDirect3D_Device->Present(NULL, NULL, NULL, NULL);
- ValidateRect(hwnd, NULL);
- return(0);
- }
- return(DefWindowProc(hwnd, msg, wParam, lParam));
- }
Expand|Select|Wrap|Line Numbers
- Error 1 error C2061: syntax error : identifier '__RPC__out_xcount_part' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\objidl.h 11280 1 StartHere
- Error 2 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\objidl.h 11281 1 StartHere
- Error 3 error C1903: unable to recover from previous error(s); stopping compilation c:\program files (x86)\microsoft sdks\windows\v7.0a\include\objidl.h 11281 1 StartHere
- 4 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3777 64
- 5 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3777 79
- 6 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3778 64
- 7 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3778 79
- 8 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3782 60
- 9 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3782 75
- 10 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3783 60
- 11 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3783 75
- 12 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3787 57
- 13 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3787 72
- 14 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3788 57
- 15 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3788 72
- 16 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3792 61
- 17 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3792 76
- 18 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3793 61
- 19 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3793 76
- 20 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3797 59
- 21 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3797 74
- 22 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3798 59
- 23 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3798 74
- 24 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3802 58
- 25 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3802 73
- 26 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3803 58
- 27 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3803 73
- 28 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3807 63
- 29 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3807 78
- 30 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3808 63
- 31 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3808 78
- 32 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3812 66
- 33 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3812 81
- 34 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3813 66
- 35 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3813 81
- 36 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3817 62
- 37 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3817 77
- 38 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3818 62
- 39 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3818 77
- 40 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3822 59
- 41 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3822 74
- 42 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3823 59
- 43 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3823 74
- 44 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3827 63
- 45 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3827 78
- 46 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3828 63
- 47 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3828 78
- 48 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3832 61
- 49 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3832 76
- 50 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3833 61
- 51 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3833 76
- 52 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3837 60
- 53 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3837 75
- 54 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3838 60
- 55 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3838 75
- 56 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3842 65
- 57 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3842 80
- 58 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3843 65
- 59 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oleidl.h 3843 80
- 60 IntelliSense: identifier "__RPC__in_range" is undefined c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 2134 31
- 61 IntelliSense: expected a ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 2134 47
- 62 IntelliSense: expected a type specifier c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 2134 49
- 63 IntelliSense: expected a ';' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 2134 56
- 64 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5185 58
- 65 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5185 73
- 66 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5186 58
- 67 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5186 73
- 68 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5190 71
- 69 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5190 86
- 70 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5191 71
- 71 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5191 86
- 72 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5195 61
- 73 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5195 76
- 74 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5196 61
- 75 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5196 76
- 76 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5200 60
- 77 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5200 75
- 78 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5201 60
- 79 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5201 75
- 80 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5205 73
- 81 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5205 88
- 82 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5206 73
- 83 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5206 88
- 84 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5210 63
- 85 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5210 78
- 86 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5211 63
- 87 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h 5211 78
- 88 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9372 58
- 89 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9372 73
- 90 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9373 58
- 91 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9373 73
- 92 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9377 58
- 93 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9377 73
- 94 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9378 58
- 95 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9378 73
- 96 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9382 60
- 97 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9382 75
- 98 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9383 60
- 99 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9383 75
- 100 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9387 60
- 101 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9387 75
- 102 IntelliSense: type name is not allowed c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9388 60
- 103 IntelliSense: expected an expression c:\program files (x86)\microsoft sdks\windows\v7.0a\include\urlmon.h 9388 75