您的位置:首页 > 编程语言 > C语言/C++

Visual C++:error C2664: 'GetModuleFileNameW' : cannot convert parameter 2 from 'char' to 'LPWCH'

2014-04-12 20:25 1011 查看
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 call
DoSomeFunction
. The portable way would be then to use
TCHAR
because it is defined as
char
for ANSI and
wchar_t
for Unicode.

If you don't want to compile with Unicode, you can change your project settings to
Project Properties -> Configuration Properties -> General -> Character Set -> Use Multibyte Character
Set
.

If you do want to compile with Unicode, then you should append an
A
(ex:
GetModuleFileNameA
) to the necessary function names.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐