I only have one error in my code and I dont know why it is wrong!
(I have not run the code, but the part that is underlined in red sais:
A value of type "long" cannot be used to initialize an entitity of type "HWND")
All i am trying to do is create a window.
Here is the part with the error. Its where I create a window.
How do I fix this?
HWND WINAPI CreateWindowEx(
"The title of my window",
CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
NULL, NULL, hInstance, NULL);
if(hwnd == NULL)
MessageBox(NULL, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
SORRY! I fixed the problem.
The HWND WINAPI part is from the declaration of CreateWindowEx. Why did you put it in the call? It should be something like:
For future reference, we have a forum specific to Windows programming. Use it. (I didn't move this thread because it's not really about Windows programming, and more about function usage.)
HWND hwnd = CreateWindowEx(...)
Also, it would be helpful if you pointed out exactly which line is underlined.
Ya, I did that just before you posted.
Anyway, sorry about posting here, I didnt see the other forum. Ill use it next time.
Is there a reason you are using the Win32 API instead of, say, Qt?