Home > Software engineering >  [please god help jie 'jue] [" WNDCLASS * "type of real participation" const WNDC
[please god help jie 'jue] [" WNDCLASS * "type of real participation" const WNDC

Time:09-27

Sun Xin in c + + code compilation is not through, ask god to help solve, thank you!
Int the CALLBACK WinMain (
_In_ HINSTANCE HINSTANCE,

_In_ HINSTANCE hPrevInstance,_In_ LPSTR lpCmdLine,
_In_ int nCmdShow
)
{
WNDCLASS WNDCLS;
WNDCLS. CbClsExtra=0;
WNDCLS. CbWndExtra=0;
WNDCLS. HbrBackground=(HBRUSH) GetStockObject (BLACK_BRUSH);
WNDCLS. HCursor=LoadCursor (NULL, IDC_CROSS);
WNDCLS. HIcon=LoadIcon (NULL, IDI_ERROR);
WNDCLS. HInstance=hInstance;
WNDCLS. LpfnWndProc=WinSunProc;
WNDCLS. LpszClassName="WeiXin2003";
WNDCLS. LpszMenuName=NULL;
WNDCLS. Style=CS_HREDRAW | CS_VREDRAW;
RegisterClass (& amp; WNDCLS); compile error: [" WNDCLASS * "type of real participation" const WNDCLASSA * "type parameter is not compatible with]

The HWND HWND;
HWND=CreateWindow (" WeiXin2003 ", "micro new science technology training center in Beijing," WS_OVERLAPPEDWINDOW, 0, 0, 600, 400, NULL, NULL, hInstance, NULL);
ShowWindow (HWND, SW_SHOWNORMAL);
UpdateWindow (HWND);
MSG MSG.
While (GetMessage (& amp; MSG, NULL, 0, 0))
{
TranslateMessage (& amp; MSG);
DispatchMessage (& amp; MSG);
}
return 0;

}

CodePudding user response:

Project compilation environment didn't repair it yourself. # include & lt; Windows. H> ?

CodePudding user response:

reference 1st floor zgl7903 response:
project compilation environment didn't repair it yourself. # include & lt; Windows. H> ?

Not in front of the poster, # include

CodePudding user response:

Use RegisterClassA or RegisterClassW,
The problem of the main character set,

CodePudding user response:

Whether the code set the multibyte or the conflict between UNICODE and compile environment Settings

CodePudding user response:

RegisterClass ( (const WNDCLASSA *) & amp; WNDCLS);

CodePudding user response:

RegisterClass (& amp; WNDCLS); Compile error: [" WNDCLASS * "type of real participation" const WNDCLASSA * "type parameter is not compatible with]
This code should be no wrong,

CodePudding user response:

Set the multibyte in my code, can you tell me how to modify? At that time set up many bytes is to use wndclass function is a compiler error [parameters can not be from "LPCTSTR" into "const char *"]

CodePudding user response:

reference Saleayas reply: 3/f
use RegisterClassA or RegisterClassW,
Main character set,


Set the multibyte in my code, can you tell me how to modify? At that time set up many bytes is to use wndclass function is a compiler error [parameters can not be from "LPCTSTR" into "const char *"]
  • Related