Показать сообщение отдельно
Старый 05.08.2007, 00:56   #481
Guest
 
Сообщений: n/a
Unhappy

Доброе время суток.
Вопрос(просьба) наитупейшая, но я устал уже более недели пытаться решить вот такую ситуацию -
хочу научиться(познать) С++ и ДиректХ, но при создании окна у меня пишет вот такие ошибки:
Цитата:
Compiling...
cc.cpp
c:\documents and settings\mpak\мои документы\visual studio 2005\projects\cc\cc\cc.cpp(124) : error C2440: '=' : cannot convert from 'char [4]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\mpak\мои документы\visual studio 2005\projects\cc\cc\cc.cpp(138) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'char [4]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\mpak\мои документы\visual studio 2005\projects\cc\cc\cc.cpp(152) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
А вот отрывки с этими строками:
Цитата:
int WINAPI WinMain( HINSTANCE hinstance,
HINSTANCE hprevinstance,
LPSTR lpcmdline,
int ncmdshow)
{
WNDCLASSEX wcex;
MSG msg;
HWND hWnd;
wcex.cbSize = sizeof(wcex);
wcex.style = CS_CLASSDC;
wcex.lpfnWndProc = MainWinProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hinstance;
wcex.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = NULL;
wcex.lpszMenuName = NULL;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClassEx(&wcex))
return FALSE;
hWnd = CreateWindowEx(NULL, szWindowClass, szTitle, OVERLAPPEDWINDOW | WS_VISIBLE, 300,150, 500,400, NULL, NULL, hinstance, LoadIcon(NULL, IDI_APPLICATION));
return(0);
if(!hWnd)
return FALSE;
ShowWindow(hWnd, SW_NORMAL);
UpdateWindow(hWnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return(msg.wParam);
}
Смотрел и в книжки и в Хелп, но решить проблему не могу
Зарание спосибо.
 
Ответить с цитированием