The Variant data type is the data type for all variables.

  can contain any kind of data except fixed-length String data.

You can use the Variant data type in place of any data type to work with data in a more flexible way. If the contents of a Variant variable are digits, they may be either the string representation of the digits or their actual value, depending on the context.

变体类型VARIANT 其实是一个结构,结构中用一个vt成员表示数据的类型,同时真正的数据则存储在union空间中。

1.        struct VARIANT
2.        {
3.            VARTYPE vt;                     //数据类型 
4.            union
5.            {
6.                LONG            lVal;       //VT_I4 
7.                VARIANT_BOOL    boolVal     //VT_BOOL 
8.                BSTR            bstrVal;    //VT_BSTR 
9.            }
10.    };

http://blog.csdn.net/hsqaihkl/article/details/9149081

上面的结构为了帮助理解,实际的定义如下

typedef struct tagVARIANT {
union {
struct __tagVARIANT {
VARTYPE vt;
WORD wReserved1;
WORD wReserved2;
WORD wReserved3;
union {
LONGLONG llVal;
LONG lVal; ...... UINT *puintVal;
struct __tagBRECORD {
PVOID pvRecord;
IRecordInfo *pRecInfo;
} __VARIANT_NAME_4;
} __VARIANT_NAME_3;
} __VARIANT_NAME_2;
DECIMAL decVal;
} __VARIANT_NAME_1;
} VARIANT, *LPVARIANT, VARIANTARG, *LPVARIANTARG;

Variant structure

http://msdn.microsoft.com/en-us/library/windows/desktop/ms221627(v=vs.85).aspx

Variant date type

http://msdn.microsoft.com/en-us/library/office/gg251448.aspx

COleVariant  基于  Variant

自动化技术的难点在于数据的传递。应用VARIANT type,which is a tagged union, it has a data member for the value (this is an anonymous C++ union) and a data member indicating the type of information stored in the union.

The VARIANT type is encapsulated in the COleVariant class. The supporting CURRENCY and DATEclasses are encapsulated in the COleCurrency and COleDateTime classes.

_____OLE antomation

OLE, object linking and enbeding, 对象链接和嵌入。

OLE自动化:一个程序有计划的控制另一个程序的能力

OLE 控件: 小型的组件程序,可嵌入到另外的程序,提供自己专有的功能。

OLE文档:完善早期的混合文档功能,不但支持简单链接和嵌入,还支持在位激活和拖放

服务器: 通过特定的接口,将自己完成的一些功能,提供给使用自己的一些程序。 如绘图程序就是一个文档服务器。

automation 和OLE文档技术类似,允许一个应用程序 编程控制 另一个应用程序“自愿”提供的功能的技术,称为OLE自动化。                         前一个应用程序:自动化客户或控制器。另一个应用程序称为自动化服务器。

如VC 控制 excel. VC 是自动化客户。 excel 是服务器。

随着对OLD技术的要求越来越广泛,微软将其用新的标签代替,即 ActiveX.

参考

http://blog.csdn.net/feijj2002_/article/details/466215

_____COleSafeArray       //a,用于数组

COleSafeArray derives from the OLE VARIANT structure. The OLE SAFEARRAY member functions are available through COleSafeArray, as well as a set of member functions specifically designed for one-dimensional arrays of bytes.

COleVariant 似乎与Variant 用法差不大,但又是两个东西。

Variant OLE automation的更多相关文章

  1. SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configur

    参见:http://msdn.microsoft.com/zh-cn/library/ms191188(SQL.105).aspx Ole Automation Procedures 选项 [本主题为 ...

  2. SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问

    --开启 Ole Automation Procedures sp_configure ; GO RECONFIGURE; GO sp_configure ; GO RECONFIGURE; GO E ...

  3. SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程 'sys.sp_OACreate' 的访问

    sqlserver2008导入excel到数据库的时候报错: SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程 'sys.sp_OACreate' ...

  4. [转]COPY OR MOVE FILES AND FOLDERS USING OLE AUTOMATION

    本文转自:http://sqlindia.com/copy-move-files-folders-using-ole-automation-sql-server/ I love playing aro ...

  5. (在数据库中调用webservices。)SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问

    --开启 Ole Automation Procedures sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_config ...

  6. SQLServer访问WebServices提示:SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问

    问题描述 在数据库中调用webservices, 提示:SQLServer访问WebServices提示:SQL Server 阻止了对组件 'Ole Automation Procedures' 的 ...

  7. PeopleSoft OLE Automation error in Workbooks.Open: ObjectDoMethod: Microsoft Excel 不能访问文件

    os: WinServer 2012 R2 64位 问题描述:PeopleSoft Web端运行AE 报上图错误,AD工具直接Test正常 解决方案: 运行> dcomcnfg 这将打开组件服务 ...

  8. C++ VARIANT 学习小记录

    一:为什么会有这个? 目前,计算机语言有很多(大哥,为什么不能就那么一样呢?),如C++.Java,此外还有JavaScript.VBScript等脚本语言,它们自立门派,各自维护自己的数据类型. C ...

  9. Delphi Variant oleVariant

    The OleVariant type exists on both the Windows and Linux platforms. The main difference between Vari ...

随机推荐

  1. 用collectionview实现瀑布流-转

    算法总体思路 先说一下总体上的思路.既然图片的大小.位置各不一样,我们很自然地会想到需要算出每个item的frame,然后把这些frame赋值给当前item的UICollectionViewLayou ...

  2. 第七课第四节,T语言流程语句(版本5.0)

    break语句 通常用在循环.遍历语句中.当跳出(break)语句用于循环语句中时,可使程序终止循环而执行循环后面的语句, 通常跳出 语句总是与如果语句联在一起.即满足条件时便跳出循环.可以说:跳出语 ...

  3. html5本地存储的解决

    1.解决了Cookie  4K存储大小的问题2.解决了请求头常带存储信息的问题3.解决了关系型存储的问题4.跨域问题,跨浏览器*在 HTML5 中,数据不是由每个服务器请求传递的,而是只有在请求时使用 ...

  4. 【Gerrit】Gerrit与Jenkins/Hudson CI服务器搭建

    配置Git 很多系统(例如Linux)已经默认提供了Git,在Git主页也可以找到安装程序.对于Windows用户,最好的选择是MsysGit.请注意,如果你安装了Apple Developer To ...

  5. LeetCode 【21. Merge Two Sorted Lists】

    Merge two sorted linked lists and return it as a new list. The new list should be made by splicing t ...

  6. php-fpm 老是warning 进程退出问题

    http://yangjunwei.com/a/723.html 分析Centos系统下LNMP频繁502 Bad Gateway问题 2012-01-28 杨俊伟 )     最近VPS总是出现 N ...

  7. LAMP平台搭建菜鸟入门级实验

    LAMP平台搭建(菜鸟入门级) mysql 安装: (1)二进制安装  二进制安装 ,执行解压配置即可.无须执行三布安装. (2)源码编译安装 安装准备工作: (1)查看系统配置:#uname -a/ ...

  8. 各种数据分析图demo

    极地蛛网图:http://www.hcharts.cn/demo/index.php?p=61 各种数据分析图demo: http://www.hcharts.cn/demo/index.php?p= ...

  9. HTML5能取代IOS原生应用吗

    介绍 移动应用程序(App)和HTML5都是目前最火的技术,二者之间也有不少重叠之处.在移动设备浏览器里运行的html5的web页面,也可以重新打包成不同平台上运行的app.目前很多浏览器都有很好的跨 ...

  10. Visual Tracker Benchmark

    直接的方法: 首先将代码先拷到benchmark_v1.0/tackers/这个文件夹下,你会发现里面已有好几个算法的代码文件夹了. 这边注意了,我就是这样的,没有注意把代码拷贝进去之后要自己写一个调 ...