J'ai mis ce sujet ici car je code sous VC++

Comme je ne connais pas du tout les API, je me permet de demander conseil

voila alors j'ai regardé dans le tutorial du site le code pour ouvrir une simple fenêtre API, que voici :


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
 
#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);
    }
}
Il compile bien, mais il me met une erreur de lien :
"error LNK2001: unresolved external symbol _main"

Or comme il s'agit d'un pgm windows, je pense (dite-moi si je me trompe) que l'on n'a pas besoin de mettre un "main" pur C++

Je pense que ça doit etre tout con, j'ai du oublier un truc, mais j'arrive pas à trouver quoi...

merci d'avance