Помогите срочно нужна помошь.
Не удаётся скомпилировать код:
Код:
// INCLUDES ///////////////////////////////////////////////
#define WIN32_LEAN_AND_MEAN // just say no to MFC
#pragma comment(lib,"dxguid.lib")
#pragma comment(lib,"d3d9.lib")
#include "windows.h" // include important windows stuff
#include "windowsx.h"
#include <d3d9.h>
#include "xdirect3d.h"
// defines for windows
#define WINDOW_CLASS_NAME "WINXCLASS" // class name
// setup a 640x480 16-bit windowed mode example
#define WINDOW_TITLE "Kolobok"
// PROTOTYPES /////////////////////////////////////////////
// game console
int Init_Game();
int Main_Game();
int Shutdown_Game();
// GLOBALS ////////////////////////////////////////////////
HWND main_window_handle = NULL; // save the window handle
HINSTANCE main_instance = NULL; // save the instance
// FUNCTIONS //////////////////////////////////////////////
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wparam,
LPARAM lparam)
{
// this is the main message handler of the system
PAINTSTRUCT ps; // used in WM_PAINT
HDC hdc; // handle to a device context
// what is the message
switch(msg)
{
case WM_CREATE:
{
// do initialization stuff here
return(0);
} break;
case WM_PAINT:
{
// start painting
hdc = BeginPaint(hwnd,&ps);
// end painting
EndPaint(hwnd,&ps);
return(0);
} break;
case WM_DESTROY:
{
// kill the application
PostQuitMessage(0);
return(0);
} break;
default:break;
} // end switch
// process any messages that we didn't take care of
return (DefWindowProc(hwnd, msg, wparam, lparam));
} // end WinProc
// WINMAIN ////////////////////////////////////////////////
int WINAPI WinMain( HINSTANCE hinstance,
HINSTANCE hprevinstance,
LPSTR lpcmdline,
int ncmdshow)
{
WNDCLASSEX winclass; // this will hold the class we create
HWND hwnd; // generic window handle
MSG msg; // generic message
// first fill in the window class stucture
winclass.cbSize = sizeof(WNDCLASSEX);
winclass.style = CS_DBLCLKS | CS_OWNDC |
CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc = WindowProc;
winclass.cbClsExtra = 0;
winclass.cbWndExtra = 0;
winclass.hInstance = hinstance;
winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName = NULL;
winclass.lpszClassName = WINDOW_CLASS_NAME;
winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
// save hinstance in global
main_instance = hinstance;
// register the window class
RegisterClassEx(&winclass);
// create the window
hwnd = CreateWindowEx(NULL, // extended style
WINDOW_CLASS_NAME, // class
WINDOW_TITLE, // title
WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION,
0,0, // initial x,y
SCREEN_WIDTH,SCREEN_HEIGHT, // initial width, height
NULL, // handle to parent
NULL, // handle to menu
hinstance, // instance of this application
NULL); // extra creation parms
// save main window handle
main_window_handle = hwnd;
Init_Game();
// enter main event loop
while(1)
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
// test if this is a quit
if (msg.message == WM_QUIT)
break;
// translate any accelerator keys
TranslateMessage(&msg);
// send the message to the window proc
DispatchMessage(&msg);
} // end if
// main game processing goes here
Main_Game();
} // end while
// shutdown game and release all resources
Shutdown_Game();
return 0;
}
//////////////////////////////////////////////////////////
int Init_Game()
{
Init_Direct3D();
return 0;
}
//////////////////////////////////////////////////////////
int Main_Game()
{
return 0;
}
//////////////////////////////////////////////////////////
int Shutdown_Game()
{
return 0;
}
//////////////////////////////////////////////////////////
Компилятор выдаёт следуюшие ошибки:
Цитата:
1>.\game.cpp(108) : error C2440: '=' : cannot convert from 'const char [10]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\game.cpp(127) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [10]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Кто-нибудь знает как исправить эти ошибки и чем они вызваны.