Error in CreateWindow Child

here's part of my code;

#define ID_SELECT 1;

HINSTANCE hInst;
static TCHAR szSelect[] = TEXT("Select");
static HWND hwndButton;
static int cxChar, cyChar ;

cxChar = LOWORD(GetDialogBaseUnit());
cyChar = HIWORD(GetDialogBaseUnits ());

hwndButton = CreateWindow (TEXT("BUTTON"),szSelect,
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
cxChar, cyChar,
20*cxChar, 7*cyChar/4,
hwnd,(HMENU) ID_SELECT,
hInst,NULL);

the error during compile
Error 2 error C2143: syntax error : missing ')' before ';' d:\document\visual studio 2008\projects\binarysearch\binarysearch\wordsearch.c 122
Error 3 error C2198: 'CreateWindowExW' : too few arguments for call d:\document\visual studio 2008\projects\binarysearch\binarysearch\wordsearch.c 122
Error 4 error C2143: syntax error : missing ';' before ',' d:\document\visual studio 2008\projects\binarysearch\binarysearch\wordsearch.c 122

please help...

Your code doesn't show how the HINSTANCE variable is being assigned a valid value. I don't think that's the cause of the compiler error though. It looks like your CreateWindow() call is being macroed into CreateWindowExW(), which takes an extra parameter. Try putting a zero there...

CreateWindowExW(0,_T("BUTTON"),szSelect....

i tried doing that but it still give me the same error...

i somehow manage to solved the problem...it's a beginner mistake

#define ID_SELECT 1; <-------- no need semicolon

thanks anyway =)
Topic archived. No new replies allowed.