描述:
在程序的我用::CoCreateInstance编译是可以通过的,但用::CoCreateInstanceEx却编译通不过
错误:
:\TestVC\com\Test1\Test1.cpp(42) : error C2039: 'CoCreateInstanceEx' : is not a member of '`global namespace''
D:\TestVC\com\Test1\Test1.cpp(42) : error C2065: 'CoCreateInstanceEx' : undeclared identifier
去掉::也通不过error C2065: 'CoCreateInstanceEx' : undeclared
郁闷???加objbase.h也是一样
解决方案1:
在程序的最开头定义一句
#define WINVER 0x0500
试试
AnsiToUnicode 是它自己写的一个函数吧。
用这个MultiByteToWideChar
AnsiToUnicode??没见过这样的函数,如果有那转换不是很方便了吗?估计是你书上的自定义函数
解决方案4:那你看看那个H头文件里有没有CoCreateInstanceEx
解决方案5:把debug目录下面的东西都删掉,然后rebuild all看看。
解决方案6: CoCreateInstanceEx
Requirements
Windows NT/2000/XP: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in objbase.h.
Library: Use ole32.lib.
查MSDN的
Requirements
Windows NT/2000/XP: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in objbase.h.
Library: Use ole32.lib.
加
Ole32.lib