描述:
我是基于COM做一个ActiveX, 将必须的文件包含进来后,编译时出现如下错误:
--------------------Configuration: ActMeet - Win32 Unicode Release--------------------
Compiling...
clutil.cpp
E:\MyProject\ActMeet\clutil.cpp(580) : error C2664: 'WideCharToMultiByte' : cannot convert parameter 5 from 'unsigned short *' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Generating Code...
Compiling...
imsconf2.c
E:\MyProject\ActMeet\imsconf2.c(135) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.
ActMeet.ocx - 2 error(s), 0 warning(s)
大家帮我看看是不是我少包含了一个头文件或是什么的? 谢谢!!!
解决方案1:
UPUP
解决方案2: 第一个错误就是把WideCharToMultiByte第5个参数强制转换成char *就可以了
第二个错误很常见,一般就是你的大括号数目不等,或者哪里少了分号,具体看这个帖子http://expert.csdn.net/Expert/topic/2398/2398212.xml?temp=.7929956
不用 unicode 编译