void keybd_event help

hey i need a little bit of help i cant get this working
Why dont this work?
1
2
3
4
5
6
7
ClickKey('D', 25);
void ClickKey(char KEY, int TIME)
{
	keybd_event(KEY,0,0,0);
	Sleep(TIME);
	keybd_event(KEY,0,KEYEVENTF_KEYUP,0);
}


But this works
1
2
3
keybd_event('D',0,0,0);
Sleep(25);
keybd_event('D',0,KEYEVENTF_KEYUP,0);


What am i doing wrong in my void?
try quotes instead of apostrophes- " instead of '.. it will probably produce a warning cause quotes are a string and it would be an implicit conversion to type *char but depending on the function definition that may work
anyway to do it with out errors?
oh my bad must of done something wrong the 1st time but it works with
ClickKey('D', 1000);
Topic archived. No new replies allowed.