Apr 9, 2013 at 9:16am UTC
Is there any mistake in this code?
2 3 // i declare these as a global variable
#define ID_EDIT1 210;
2 3 4 5 6 7 8 9 10 11 12 13 14 case WM_CREATE:
HWND Edit1 = CreateWindowEx(
0, L "EDIT",
WS_CHILD | WS_VISIBLE | WS_VSCROLL |
ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL,
0, 0, 0, 0,
(HMENU) ID_EDIT1, //expected `)' before ';'token
NULL); //expected `;' before ')' token
I don't know why am i keep these error messages.
Last edited on
Apr 9, 2013 at 11:40am UTC
Apr 10, 2013 at 12:43am UTC
I guess ID_EDIT1 is included in a resource.h file.
Try including resource.h at the top of your .cpp file.
Apr 10, 2013 at 9:34am UTC
I did make a resource file, but i didn't define that variable in my source file. So i don think that is the cause of the problem. 1 more strange error happen, when i change the hmenu argument into NULL, the previous errors gone ?? But i get new error:
cannot convert `
const wchar_t* ' to `const CHAR*' for argument `2 ' to `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
I really don't get it...is there something corrupted in my CPP directory?
Apr 10, 2013 at 9:39am UTC
Ah i get it, it is the L macros, i don't usually use them, and never expect it could cause this weird errors. Sorry for causing some confusion, and thanks for helping me.