比如
var
a,b:Variant;
....
a:=CreateOleObject('...');问题
1、a,b声明Variant变量和OleVariant变量有什么区别;
2、假如b:=a;b是引用a的指针,还是a的实例;如果只是引用指针的话,如何b拷贝a的一份实例;
3、退出程序时,a要不要释放,如何释放
4、a能不能写成流文件

解决方案 »

  1.   

    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.OleVariant可以理解为一个容器,Variant不能容纳对象
      

  2.   

    CreateOleObject创建的对象,如果是接口,一般置为nil,如果是对象则调用析构函数释放。