The HWND HWND;
MSG MSG.
TCHAR szWindowClass []=L "Example";
TCHAR szTitle []=L "My Windows";
Wcex. CbSize=sizeof (modifed WNDCLASSEX);
Wcex. Style=0;
Wcex. LpfnWndProc=WndProc;
Wcex. CbClsExtra=0;
Wcex. CbWndExtra=0;
Wcex. HInstance=hInstance;
Wcex. HIcon=LoadIcon (hInstance, MAKEINTRESOURCE (IDI_APPLICATION));
Wcex. HCursor=LoadCursor (NULL, IDC_ARROW);
Wcex. LpszMenuName=NULL;
Wcex. LpszClassName=szWindowClass;
Wcex. HIconSm=LoadIcon (wcex hInstance, MAKEINTRESOURCE (IDI_APPLICATION));
if (! RegisterClassEx (& amp; Wcex)) {
MessageBox (NULL, _T (" window class registration failed!" ), _T (" window to register "), NULL);
return 1;
}
Code are made according to the book, the comparison again found no errors, displays the running of the VS2019 and DevC++ window class registered failure, RegisterClassEx function return value is zero, could you tell me where is the problem
CodePudding user response:
GetLastError () to see the error code is?CodePudding user response: