LRESULT a CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
Int WINAPI WinMain (HINSTANCE HINSTANCE, HINSTANCE hPrveIntance, PSTR szCmdLine, int iCmdShow)
{
The static TCHAR szAPPName []=TEXT (" MyWindows ");
The HWND HWND;
MSG MSG.
WNDCLASS WNDCLASS;
Wndclass. Style=CS_HREDRAW | CS_VREDRAW;
Wndclass. LpfnWndProc=WndProc;
Wndclass. CbClsExtra=0;
Wndclass. CbWndExtra=0;
Wndclass. HInstance=hInstance;
Wndclass. HIcon=LoadIcon (NULL, IDI_APPLICATION);
Wndclass. HCursor=LoadCursor (NULL, IDC_ARROW);
Wndclass. HbrBackground=(HBRUSH) GetStockObject (WHITE_BRUSH);
Wndclass. LpszMenuName=NULL;
Wndclass. LpszClassName=szAPPName;
if (! RegisterClass (& amp; Wndclass))
{
MessageBox (NULL, TEXT (" RESULT "), szAPPName, MB_OK | MB_ICONWARNING);
return 0;
}
HWND=CreateWindow (szAPPName,
The TEXT (" space "),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
HInstance,
NULL);
ShowWindow (HWND, iCmdShow);
While (GetMessage (& amp; MSG, NULL, 0, 0))
{
TranslateMessage (& amp; MSG);
DispatchMessage (& amp; MSG);
}
Return MSG. WParam;
}
LRESULT a CALLBACK WhdProc (HWND HWND, UINT message, WPARAM WPARAM, LPARAM LPARAM)
{
HDC HDC.
PAINTSTRUCT ps;
The RECT the RECT.
The switch (the message)
{
In case the WM_PAINT:
HDC=BeginPaint (HWND, & amp; Ps);
GetClientRect (HWND, & amp; The rect);
DrawText (HDC, TEXT (" hello "), 1, & amp; The rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
EndPaint (HWND, & amp; Ps);
return 0;
}
Return DefWindowProc (HWND, message, wParam, lParam);
}
CodePudding user response:
Cannot resolve external command?CodePudding user response:
Severity code shows the project file line prohibits display statusError LNK2019 cannot resolve the external symbol "long __stdcall WndProc (struct HWND__ *, unsigned int, unsigned int, long)" (? WndProc @ @ YGJPAUHWND__ @ @ IIJ @ Z), the symbol referenced in the function _WinMain @ 16 Project1 C: \ Users \ \ source \ 10045 repos \ Project1 \ Project1 \ source. Obj 1