Variant OLE automation
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的更多相关文章
- SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configur
参见:http://msdn.microsoft.com/zh-cn/library/ms191188(SQL.105).aspx Ole Automation Procedures 选项 [本主题为 ...
- SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问
--开启 Ole Automation Procedures sp_configure ; GO RECONFIGURE; GO sp_configure ; GO RECONFIGURE; GO E ...
- SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程 'sys.sp_OACreate' 的访问
sqlserver2008导入excel到数据库的时候报错: SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程 'sys.sp_OACreate' ...
- [转]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 ...
- (在数据库中调用webservices。)SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问
--开启 Ole Automation Procedures sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_config ...
- SQLServer访问WebServices提示:SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问
问题描述 在数据库中调用webservices, 提示:SQLServer访问WebServices提示:SQL Server 阻止了对组件 'Ole Automation Procedures' 的 ...
- PeopleSoft OLE Automation error in Workbooks.Open: ObjectDoMethod: Microsoft Excel 不能访问文件
os: WinServer 2012 R2 64位 问题描述:PeopleSoft Web端运行AE 报上图错误,AD工具直接Test正常 解决方案: 运行> dcomcnfg 这将打开组件服务 ...
- C++ VARIANT 学习小记录
一:为什么会有这个? 目前,计算机语言有很多(大哥,为什么不能就那么一样呢?),如C++.Java,此外还有JavaScript.VBScript等脚本语言,它们自立门派,各自维护自己的数据类型. C ...
- Delphi Variant oleVariant
The OleVariant type exists on both the Windows and Linux platforms. The main difference between Vari ...
随机推荐
- DIV+CSS制作二级横向弹出菜单,略简单
没有使用JavaScript控制二级菜单的显示,结果如上图所示. 代码如下: <!DOCTYPE html> <html> <head> <meta char ...
- (实用篇)PHP定时任务获取微信access_token
最近开发微信公众平台,公众号调用各接口时都需使用access_token,access_token是公众号的全局唯一接口调用凭据,开发时需要进行妥善保存. access_token有效期为7200秒 ...
- 去掉EditPlus自动备份bak文件
用EditPlus编辑文件是总是自动生成一个.bak文件. 其实想去掉EditPlus的自动备份也简单,方法如下: 打开菜单栏上的:工具->参数设置->文件 去掉“保存时创建备份文件”前的 ...
- JQUERY知识总结
1, 让页面上某一个已存在的SELECT被选中的JQuery写法 $("#test").find("option[value='3']").prop(&quo ...
- tar
必要参数有如下: -A 新增压缩文件到已存在的压缩 -B 设置区块大小 -c 建立新的压缩文件 -d 记录文件的差别 -r 添加文件到已经压缩的文件 -u 添加改变了和现有的文件到已经存在的压缩文件 ...
- BigDecimal在实际项目的应用及遇到的问题
我们都知道,java中对大小数,高精度的计算都会用到BigDecimal.但是在实际应用中,运用BigDecimal还是会遇到一些问题.下面说一下我在项目中怎么样BigDecimal和遇到的一些问题. ...
- each循环
var NA_COUNT=0; var NG_OK_COUNT=0; //获取所有检验明细为同一个编号的下拉选项,看有没有不是N/A的下拉选项 $("#@(Perfix)tbData sel ...
- require.js+backbone.js基本使用
一.菜单{ //银行卡基础信息维护 rsId: 'menu.param.cardbin', iconCls: 'icon-double-angle-right', name: menusLang._( ...
- IOCP之客户端及消息传递
上篇说到IOCP的精简实现,这篇来讲IOCP客户端和消息传递 在ConnectEx代码之前,CreateIoCompletionPort的第三个参数,把socket句柄+0x01000000作为传递 ...
- hdu 5381 The sum of gcd
知道对于一个数列,如果以x为左(右)端点,往右走,则最多会有log(a[x])个不同的gcd,并且有递减性 所以会分成log段,每一段的gcd相同 那我们可以预处理出对于每一个位置,以这个位置为左端点 ...