A lot of the "functions" of the Windows API are actually macroes to either the ANSI (A
) or Unicode (W
for wide) version of the function. Depending on your project settings, these macroes will
be either DoSomeFunctionA
or DoSomeFunctionW
when you want to callDoSomeFunction
. The portable way would be then to useTCHAR
because it is defined aschar
for ANSI and
wchar_t
for Unicode.
If you don't want to compile with Unicode, you can change your project settings toProject Properties -> Configuration Properties -> General -> Character Set -> Use Multibyte Character
Set
.
If you do want to compile with Unicode, then you should append anA
(ex:GetModuleFileNameA
) to the necessary function names.