I am trying to use ‘GetModuleFileNameA’ but I keep getting the error ‘c4430: missing type specifier – int assumed’. From reading the results from my google search I am guessing that it is from my use of NULL:
char Filename[MAX_PATH]; //this is a char buffer
GetModuleFileNameA(NULL, Filename, sizeof(Filename));
NULL is supposedly defined in #include stdio.h which I have included in my project, what am I doing wrong?
Thanks.
Have you tried GetModuleFileNameA(GetModuleHandle(0),Filename,sizeof(Filename)) ?
From MSDN GetModuleFileName description
You might want to check if this value out, and if you need it, how does it behave in multi-library environment.