请搞过COM的大富翁进来瞧瞧(100分)

W

wlmmlw

Unregistered / Unconfirmed
GUEST, unregistred user!
var
v: Varaint;
begin
v := CreateOleObject('Excel Application');
v.Visible := True; ////请问Visible是什么东东!??????
end;
 
Visible 是这个com接口的一个属性啊,这里是显示出excel
 
com接口有属性的吗?
接口的属性和类的属性是不是相同的?
如果定义?
 
接口可以有属性,但不能有域,看下面定义:
Error = interface(IDispatch)
['{00000500-0000-0010-8000-00AA006D2EA4}']
function Get_Number: Integer; safecall;
function Get_Source: WideString; safecall;
function Get_Description: WideString; safecall;
function Get_HelpFile: WideString; safecall;
function Get_HelpContext: Integer; safecall;
function Get_SQLState: WideString; safecall;
function Get_NativeError: Integer; safecall;
property Number: Integer read Get_Number;
property Source: WideString read Get_Source;
property Description: WideString read Get_Description;
property HelpFile: WideString read Get_HelpFile;
property HelpContext: Integer read Get_HelpContext;
property SQLState: WideString read Get_SQLState;
property NativeError: Integer read Get_NativeError;
end;
 
v := CreateOleObject('Excel Application');成功后,
v具有Excel.Application的所有属性、方法等
 
接口,其实应该是没有属性这种东西,只有方法,
但是delphi对它做了封装
 
请写出在类里如何实现这些属性!!!!谢谢
 
自力更生去了
 

Similar threads

S
回复
0
查看
956
SUNSTONE的Delphi笔记
S
S
回复
0
查看
779
SUNSTONE的Delphi笔记
S
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
933
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
顶部