我正在学习DirectX程序(MFC对话框),在设计这个程序时,需要借用到以前的一些MFC代码,所以我直接将相关的代码拷过来用(这些代码在纯MFC程序可以直接编译无错)。但在DirectX程序里无法编译成功,提示错误:c:\program files\visual c++\vc98\atl\include\atlconv.h(200) : error C2039: 'SysAllocStringLen' : is not a member of '`global namespace''
c:\program files\visual c++\vc98\atl\include\atlconv.h(200) : error C2065: 'SysAllocStringLen' : undeclared identifier
c:\program files\visual c++\vc98\atl\include\atlconv.h(200) : error C2440: '=' : cannot convert from 'int' to 'unsigned short *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\program files\visual c++\vc98\atl\include\atlconv.h(209) : error C2039: 'SysAllocString' : is not a member of '`global namespace''
c:\program files\visual c++\vc98\atl\include\atlconv.h(209) : error C2065: 'SysAllocString' : undeclared identifier
c:\program files\visual c++\vc98\include\xlocale(296) : warning C4663: C++ language change: to explicitly specialize class template 'codecvt' use the following syntax: template<> class codecvt<unsigned short,char,int> ...
c:\program files\visual c++\vc98\include\xlocale(519) : warning C4663: C++ language change: to explicitly specialize class template 'ctype' use the following syntax: template<> class ctype<char> ...然后我仔细地和原来的MFC程序进行比较,发现DirectX的StdAfx里面少了afxdtctl.h,我加上去之后,就能够成功通过编译了,但编译时仍然提示警告,而且非常之多:c:\program files\visual c++\vc98\include\xmemory(39) : warning C4100: '_P' : unreferenced formal parameter
c:\program files\visual c++\vc98\include\xmemory(41) : warning C4100: '_P' : unreferenced formal parameter
c:\program files\visual c++\vc98\include\xlocale(296) : warning C4663: C++ language change: to explicitly specialize class template 'codecvt' use the following syntax: template<> class codecvt<unsigned short,char,int> ...
c:\program files\visual c++\vc98\include\xlocale(387) : warning C4018: '<' : signed/unsigned mismatch
c:\program files\visual c++\vc98\include\xlocale(519) : warning C4663: C++ language change: to explicitly specialize class template 'ctype' use the following syntax: template<> class ctype<char> ...
c:\program files\visual c++\vc98\include\xlocale(552) : warning C4100: '_D' : unreferenced formal parameter
c:\program files\visual c++\vc98\include\xlocale(554) : warning C4100: '_D' : unreferenced formal parameter
c:\program files\visual c++\vc98\include\streambuf(181) : warning C4100: '_Loc' : unreferenced formal parameter
c:\program files\visual c++\vc98\include\streambuf(182) : while compiling class-template member function 'void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::imbue(const class std::locale &)'
c:\program files\visual c++\vc98\include\xlocnum(151) : see reference to function template instantiation 'int __cdecl std::_Getloctxt(class std::istreambuf_iterator<char,struct std::char_traits<char> > &,class std::istreambuf_iterator<char,s
truct std::char_traits<char> > &,unsigned int,const char *)' being compiled
c:\program files\visual c++\vc98\include\xlocale(207) : warning C4244: '=' : conversion from 'unsigned int' to 'char', possible loss of data以上只是复制了一小部分警告,编译环境都是VC6.0。但经过粗略测试能正常运行,但是请问这么多警告是什么原因导致的?我加上string.h也没有用。是DirectX程序缺少了什么吗?我刚学习DirectX,实在是很弱,要如何才能解决?谢谢了!