Bonjour,
Apr�s mon probl�me (que je ne parviens pas � r�soudre) d'�xecutable, et la remarque (je pr�cise que ce n'est pas une critique avant qu'il est un malentendu) sur le fait que mon code �tait du .Net j'ai voulu me mettre au natif mais l� j'ai � nouveau des probl�mes :
J'ai voulu suivre un tuto pour faire des interfaces en natif avec les APIs, j'ai donc install� le SDK n�cessaire et je l'ai configurer (� priori comme il faut) dans vc++ d'apr�s la doc du SDK, j'ai donc commenc� � �tudier le premier code du tuto et paffff je gagne une collection d'erreur.
Voici le code :
Et maintenant le log avec ... 12 erreurs
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 #include <windows.h> LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hwnd; MSG msg; WNDCLASS wc; wc.style = 0; wc.lpfnWndProc = MainWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = NULL; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE); wc.lpszMenuName = NULL; wc.lpszClassName = "MaWinClass"; if(!RegisterClass(&wc)) return FALSE; hwnd = CreateWindow("MaWinClass", "Titre", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 400, 300, NULL, NULL, hinstance, NULL); if (!hwnd) return FALSE; ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } /******************************************************************************/ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_CREATE: return 0; case WM_DESTROY: PostQuitMessage(0); return 0; default: return DefWindowProc(hwnd, uMsg, wParam, lParam); } }![]()
Voil� mon probl�me, qu'ai-je fait encore comme con***** ^^ ???
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 Compiling... window.cpp Linking... window.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "long __stdcall MainWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainWndProc@@YGJPAUHWND__@@IIJ@Z) window.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function "long __stdcall MainWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainWndProc@@YGJPAUHWND__@@IIJ@Z) window.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16 window.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16 window.obj : error LNK2019: unresolved external symbol __imp__GetMessageA@16 referenced in function _WinMain@16 window.obj : error LNK2019: unresolved external symbol __imp__UpdateWindow@4 referenced in function _WinMain@16 window.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function _WinMain@16 window.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function _WinMain@16 window.obj : error LNK2019: unresolved external symbol __imp__RegisterClassA@4 referenced in function _WinMain@16 window.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function _WinMain@16 window.obj : error LNK2019: unresolved external symbol __imp__LoadIconA@8 referenced in function _WinMain@16 Debug\test.exe : fatal error LNK1120: 11 unresolved externals
HS : Quels sont les inconv�niants du .Net ?
Voil� j'espere que quelqu'un peut m'aider car j'aimerais bien apprendre le C++ et je n'ai pas les moyens de m'acheter une version qui fait des fen�tres en natifs et encore moins envis de retourner sur VC++ 6.0 (qui n'�tait pas tr�s l�galece qui me donne une raison de plus pour passer au Express)
Merci d'avance
Partager