I've written this code, it looks for a file specified in the commandline and says YES if it exists or NO if it doesn't exist :
It should be working but the compiler says :Code:#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char * lpCmdLine, int nCmdShow)
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
HANDLE Find;
hFind = FindFirstFile(lpCmdLine[1], &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
printf("NO\n");
else
printf ("YES\n");
system("PAUSE");
return 0;
}
13 [Warning] passing arg 1 of `FindFirstFileA' makes pointer from integer without a cast
I dont understand it because i'm passing it a char, not an int !
Someone can help me ?
I know i should write only lpCmdLine but i need to specify [1] and [2] in my program... so i need it :( (and i cant use argc because i need WINAPI WinMain coz it has to be an hidden application)
Thanx a lot :)