| Код | #include <windows.h>
LONG WINAPI WndProc(HWND, UINT, WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hwnd; MSG msg; WNDCLASS WndClass; memset(&WndClass,0,sizeof(WNDCLASS)); WndClass.style = CS_HREDRAW | CS_VREDRAW; WndClass.lpfnWndProc = WndProc; WndClass.hInstance = hInstance; WndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); WndClass.lpszClassName = "Lab"; RegisterClass(&WndClass); hwnd = CreateWindow("Lab","OpenGL", WS_OVERLAPPEDWINDOW, 100,100,500,500, NULL, NULL, hInstance, NULL); ShowWindow(hwnd,nCmdShow); UpdateWindow(hwnd); while(GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; }
LONG WINAPI WndProc(HWND hwnd, UINT Message, WPARAM wparam, LPARAM lparam) { switch (Message){ case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, Message, wparam, lparam); } return 0; }
|
c:\documents and settings\hysteria\мои документы\visual studio 2008\projects\lab__001\lab__001\lab_001.cpp(20) : error C2440: '=' : cannot convert from 'const char [4]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\hysteria\мои документы\visual studio 2008\projects\lab__001\lab__001\lab_001.cpp(24) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [4]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
В выделенных функциях жирным - ошибка. Помогите найти решение. Заранее спасибо. |