Hey, i hope you can help me with my question: I started learning working with DirectX, in the start i saw a codeexample for how open an empty window (without chosing winn app at the start of Visual Studio) but for some reson, the code makes me problems, hope you can say to me why code
#include <windows.h>
HINSTANCE hInst; // global handle to hold the application instance
HWND wndHandle; // global variable to hold the window handle
// forward declarations
bool initWindow( HINSTANCE hInstance );
LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow )
{
// Initialize the window
if ( !initWindow( hInstance ) )
{
return false;
}
// main message loop:
MSG msg;
ZeroMemory( &msg, sizeof( msg ) );
while( msg.message!=WM\_QUIT )
{
// Check the message queue
while (GetMessage(&msg, wndHandle, 0, 0) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
return (int) msg.wParam;
}
bool initWindow( HINSTANCE hInstance )
{
WNDCLASSEX wcex;
// Fill in the WNDCLASSEX structure. This describes how the window
// will look to the system
wcex.cbSize = sizeof(WNDCLASSEX); // the size of the structure
wcex.style = CS\_HREDRAW | CS\_VREDRAW; // the class style
wcex.lpfnWndProc = (WNDPROC)WndProc; // the window procedure callback
wcex.cbClsExtra = 0; // extra bytes to allocate for this class
wcex.cbWndExtra = 0; // extra bytes to allocate for this instance
wcex.hInstance = hInstance; // handle to the application instance
wcex.hIcon = 0; // icon to associate with the application
wcex.hCursor = LoadCursor(NULL, IDC\_ARROW);// the default cursor
wcex.hbrBackground = (HBRUSH)(COLOR\_WINDOW+1); // the background color
wcex.lpszMenuName = NULL; // the resource name for the menu
wcex.lpszClassName = “DirectXExample”; // the class name being created
wcex.hIconSm = 0; // the handle to the small icon
RegisterClassEx( &wcex );
// Create the window
wndHandle = CreateWindow(
"DirectXExample",
"DirectXExample",
WS\_OVERLAPPEDWINDOW,
CW\_USEDEFAULT, // the starting x coordinate
CW\_USEDEFAULT, // the starting y coordinate
640, // the pixel width of the window
480, // the pixel height of the window
NULL, // the parent window; NULL for desktop
NULL, // the menu for the application; NULL for
hInstance, // the handle to the application instance
NULL); // no values passed to the windo