我有两个不同的项目。一个是在VS2005开发的,在项目中加入下面段:
   #ifndef _ado
#define _ado
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename ("EOF", "adoEOF")
#endif这样可以访问数据库,其中关于的_variant_t类,根据提示有25个构造函数,其中最后连个构造函数原型是:
 _variant_t ( __int64 );
 _variant_t ( unsigned __int64);
   另外一个项目,开发环境未知,好像也是VS。
我用VS2005这个项目。由于这个项目没使用COM,而我想用,所以同样加入上面那段
#ifndef _ado
#define _ado
#import "c:\program files\common files\system\ado\msado15.dll" \
no_namespace \
rename ("EOF", "adoEOF")
#endif可是奇怪的是,关于_variant_t类,提示只有23个构造函数,我怎么也找不到上面的量个函数,
 _variant_t ( __int64 );//没有
 _variant_t ( unsigned __int64);//没有
当然编译也过不去了。我很困扰,同样的头文件,同样是VS2005打开的,怎么会不同的版本呢?有什么办法解决呢?我一定要用到64位上的数据的。

解决方案 »

  1.   

    用_variant_t类型可以直接包含 它的头文件COMUTIL.H
      

  2.   

    应该是你后面那个项目没有包含头文件,所以找不到_variant_t的定义吧
      

  3.   

    #define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 2000 or later.你的这个定义太旧了,用501看看
      

  4.   

      我用了楼上几位的方法都没解决。还是找不到丢失的俩个构造函数。
    我用了新项目的预编译头文件“StdAfx.h",来替换掉旧的也不行。
    包含了COMUTIL.H也不行。