The OleVariant type exists on both the Windows and Linux platforms. The main difference between Variant and OleVariant is that Variant can contain data types that only the current application knows what to do with. OleVariant can only contain the data types defined as compatible with OLE Automation which means that the data types that can be passed between programs or across the network without worrying about whether the other end will know how to handle the data.

When you assign a Variant that contains custom data (such as a Delphi string, or a one of the new custom variant types) to an OleVariant, the runtime library tries to convert the Variant into one of the OleVariant standard data types (such as a Delphi string converts to an OLE BSTR string). For example, if a variant containing an AnsiString is assigned to an OleVariant, the AnsiString becomes a WideString. The same is true when passing a Variant to an OleVariant function parameter.
olevariant存在于windows和linux平台,这二种类型主要的不同是variant类型仅是当前的应用程序可以进行操作,而olevariant类型则是ole自动化服务器所以定义的统一的数据类型,意味着可以通过网络或其他程序进行操作,当然也不必担心其他客户端如何进行操作.

当你给一个variant类型的变量赋自定义的值的时候(例如delphi string,或一个其他的新的自定义类型),运行时间库将试着将他转化为olevariant标准数据类型(例如string转化为 OLE BSTR string),例如,一个包括Ansistring数据的variant类型斌值给olevariant,ansiString将成为WideString,当把variant传为olevariant的函数参数也是一样的.

Delphi Variant oleVariant的更多相关文章

  1. Delphi 数据类型列表 good

    Delphi 数据类型列表 分类 范围 字节 备注 简单类型 序数 整数 Integer -2147483648 .. 2147483647 4 有符号32位 Cardinal 0 .. 429496 ...

  2. Delphi 与 C/C++ 数据类型对照表

    Delphi 数据类型 C/C++ ShorInt 8位有符号整数 char Byte 8位无符号整数 BYTE,unsigned short SmallInt 16位有符号整数 short Word ...

  3. Delphi程序调用C#.Net编译的DLL并打开窗体(详解)

    Delphi程序调用C#.Net编译的DLL并打开窗体(详解)最近用C#.Net写了一个公用模块, 本以为仅提供给.Net程序使用, 但是领导要求把这些功能提供给旧系统使用, 天啦, 几套旧系统全是D ...

  4. delphi的基本数据类型

    2017年06月07日 11:02:25 阅读数:402 分类 范围 字节 备注 简单类型 序数 整数 Integer -2147483648 .. 2147483647 4 有符号32位 Cardi ...

  5. Delphi 与 C/C++ 数据类型对照表(最新的tokyo)

    更新,下面这table为最新的tokyo基本数据类型与C++的对照关系: Delphi to C++ types mapping   Go Up to Support for Delphi Data ...

  6. python4delphi 设置syspath

    详细看demo25的代码 These techniques are demonstrated in Demo25 in the examples folder of your Python for D ...

  7. [3]第二章 C++编程简介

    (本资料均从 internet 上进行收录整理,若要转载,请与原作者联系) 2.1  机器语言.汇编语言和高级语言 程序员用各种编程语言编写指令,有些是计算机直接理解的,有些则需要中间翻译(tranl ...

  8. Delphi OleVariant 类型的用法

    因客户需求,对客户的指纹机与公司产品进行集成,需要对指纹机做接口的二次开发,郁闷的是产商只提供了VB和C的DEMO示例,没有Delphi的,公司没有VB,C的环境,不能打开这二种语言的示例,因为本公司 ...

  9. delphi OleVariant转换RecordSet

    delphi OleVariant转换RecordSet uses Data.Win.ADODB; function varToRecordSet( parms : OleVariant ) : Da ...

随机推荐

  1. 小白日记17:kali渗透测试之缓冲区溢出实例-windows,POP3,SLmail

    缓冲区溢出实例 缓冲区溢出原理:http://www.cnblogs.com/fanzhidongyzby/archive/2013/08/10/3250405.html 空间存储了用户程序的函数栈帧 ...

  2. FE—— Code First 初体验 01(转)

    EF Code First 初体验   Code First 顾名思义就是先代码,再由代码生成数据库的开发方式. 废话不多说,直接来一发看看:在VS2010里新建一个空白解决方案,再依次添加两个类库项 ...

  3. Little Bishops uva861

    Little Bishops A bishop is a piece used in the game of chess which is played on a board of square gr ...

  4. Uva120 Stacks of Flapjacks 翻煎饼

    水水题.给出煎饼数列, 一次只能让第一个到第i个数列全部反转,要求把数列排序为升序. 算法点破后不值几钱... 只要想办法把最大的煎饼放到最后一个,然后就变成前面那些煎饼的数列的子题目了.递归或循环即 ...

  5. linux- svn服务器

    环境:centos6.5 安装 centos 6.5默认安装了svn server, 这里直接使用.如果没有的话,使用yum -y install subversion安装 创建版本库 3.1 创建s ...

  6. poj 2723 2-SAT问题

    思路:二分枚举能开的门的数量,将每次枚举转换成2-SAT问题.这里存在的矛盾是假设有门上a,b两个锁,a锁对应于1号钥匙,而一号钥匙的配对是2号钥匙,b锁对应于3号钥匙,3号的配对是4号钥匙.那么2号 ...

  7. MyBatis(3.2.3) - Passing multiple input parameters

    MyBatis's mapped statements have the parameterType attribute to specify the type of input parameter. ...

  8. C# PLINQ 内存列表查询优化历程

    产品中(基于ASP.NET MVC开发)需要经常对药品名称及名称拼音码进行下拉匹配及结果查询.为了加快查询的速度,所以我最开始就将其加入内存中(大约有六万五千条数据). 下面附实体类. public ...

  9. JQGrid各种参数详解API(转载)

    下面是转自其他人blog的一个学习资料,与其说是学习资料,说成查询帮助文档更加合适. jqGrid学习之 ------------- 安装 jqGrid安装很简单,只需把相应的css.js文件加入到页 ...

  10. 消息推送SignalR

    一.什么是 SignalR ASP.NET SignalR is a library for ASP.NET developers that simplifies the process of add ...