Here is the code that it gives me on page 33:
#include<Windows.h>
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE prevInstance,
LPWSTR cmdLine, int cmdShow)
{
UNREFERENCED_PARAMETER( prevInstance );
UNREFERENCED_PARAMETER( cmdLine );
WNDCLASSEX wndClass = { 0 };
wndClass.cbSize = sizeof( WNDCLASSEX ) ;
wndClass.style = CS_HREDRAW | CS_VREDRAW;
wndClass.lpfnWndProc = WndProc;
wndClass.hInstance = hInstance;
wndClass.hCursor = LoadCursor( NULL, IDC_ARROW );
wndClass.hbrBackground = ( HBRUSH )( COLOR_WINDOW + 1 );
wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = "DX11BookWindowClass";
if( !RegisterClassEx( &wndClass ) )
return -1;
RECT rc = { 0, 0, 640, 480 };
AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE );
HWND hwnd = CreateWindowA( "DX11BookWindowClass", "Blank Win32 Window",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, rc.right - rc.
left,
rc.bottom - rc.top, NULL, NULL, hInstance, NULL );
if( !hwnd )
return -1;
ShowWindow( hwnd, cmdShow );
return 0;
}
This code gives me 2 errors-
1>------ Build started: Project: BlankWindow, Configuration: Debug Win32 ------ 1> main.cpp 1>c:\coding\c++\visual c++\directx\blankwindow\blankwindow\main.cpp(10): error C2065: 'WndProc' : undeclared identifier 1>c:\coding\c++\visual c++\directx\blankwindow\blankwindow\main.cpp(15): error C2440: '=' : cannot convert from 'const char [20]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Basically
'WndProc' : undeclared identifier And '=' : cannot convert from 'const char [20]' to 'LPCWSTR'
What is wrong with this code?
page 33referring to? And where is yourWndProc? Do you know what a windows procedure is? - Jesse Good