简体   繁体   中英

C++ CreateWindow() function not defined

I started playing around with the win32 api in c++ and as i was about to make a button, the intellisense says "define CreateWindow CreateWindowA". When i seem to hover down, it also says "Error: expected a )'".

Here is my code:

CreateWindow(TEXT("button"), TEXT("You should press this button"), WS_VISIBLE | WS_CHILD, 50, 50, 300, 300, hWnd, (HMENU)somecrap, NULL, NULL);

So could you tell me what is exactly the problem? From searching the internet, people were saying it has something to do with the character set with the preprocessor, but i'm not exactly sure what to do .

The name CreateWindow is a macro. The real Win32 API functions are 2: CreateWindowA for ANSI and CreateWindowW for Unicode. Depending on UNICODE definition is used one of them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM