I've found GetModuleFileName() but it uses a TCHAR which I'm not sure how to convert.
If this is the best way, then I need help on converting TCHAR to char *.
Using TCHAR is easy. TCHAR is char if the UNICODE macro name is undefined. If UNICODE is defined, TCHAR is wchar_t.
Similarly, GetModuleFileName() expands to GetModuleFileNameA automatically if UNICODE is not defined, and expands to GetModuleFileNameW() if UNICODE is defined. That simple. You just have to consistently use the TCHAR functions.
On a side note, you should always code UNICODE modules. ANSI is for Windows 95, 98, and Me.