Bonjour !
J'ai install� le Microsoft Platform SDK comme dans cet article : http://arb.developpez.com/vc++/express/ . J'ai configur� Visual C++ Express comme dit dans cet article, seulement, quand je compile ce code :
Je me retrouve avec cet erreur :
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67 #include <windows.h> LRESULT CALLBACK MainProc(HWND Dlg,UINT message,WPARAM wParam,LPARAM lParam); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { WNDCLASSEX principale; principale.cbSize=sizeof(WNDCLASSEX); principale.style=CS_HREDRAW|CS_VREDRAW; principale.lpfnWndProc=MainProc; principale.cbClsExtra=0; principale.cbWndExtra=0; principale.hInstance=hInstance; principale.hIcon=LoadIcon(NULL,IDI_APPLICATION); principale.hCursor=LoadCursor(NULL,IDC_ARROW); principale.hbrBackground=reinterpret_cast<HBRUSH>(COLOR_WINDOW+1); principale.lpszMenuName=NULL; principale.lpszClassName="std"; principale.hIconSm=LoadIcon(NULL,IDI_APPLICATION); RegisterClassEx(&principale); HWND hWnd; hWnd=CreateWindowEx( WS_EX_CLIENTEDGE, "std", "Notre fenêtre", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL ); ShowWindow(hWnd,SW_SHOW); MSG msg; while(GetMessage(&msg,NULL,0,0)==TRUE) { TranslateMessage(&msg); DispatchMessage(&msg); } return 0; } LRESULT CALLBACK MainProc(HWND hWnd, UINT mes, WPARAM wParam, LPARAM lParam) { HDC hDC; PAINTSTRUCT paintst; switch (mes) { case WM_PAINT: hDC=BeginPaint(hWnd,&paintst); EndPaint(hWnd,&paintst); return 0; case WM_DESTROY: PostQuitMessage(0); return 0; default: return DefWindowProc(hWnd, mes, wParam, lParam); } }
.c:\documents and settings\fab 22\mes documents\visual studio 2005\projects\testw2\testw2\source1.cpp(23) : error C2440: '=' : cannot convert from 'const char [4]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\documents and settings\fab 22\mes documents\visual studio 2005\projects\testw2\testw2\source1.cpp(40) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [4]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://c:\Documents and Settings\Fab 22\Mes documents\Visual Studio 2005\Projects\TestW2\TestW2\Debug\BuildLog.htm"
1>TestW2 - 2 error(s), 0 warning(s)
========== G�n�ration*: 0 a r�ussi, 1 a �chou�, 0 mis � jour, 0 a �t� ignor� ==========
J'essaye avec un autre code Win32, m�mes erreurs.
Est ce que �a vous est arriv� ? Moi, je n'arrive pas � compiler du Win32 malgr� l'installation du Platform SDK ...
Avez vous une solution ?
Merci d'avance![]()
Partager