热情软件屋

 

Delphi的interface声明


编号:QA003449
建立日期: 2000年10月23日 最后修改日期:2000年10月23日
所属类别:

xxzzyy:
    您好!我在看delphi5参考书时,看到以下的声明:
     imyinterface=interface
     procedure p1;
     procedure p2;
     end;
     tmyimplclass=class
     procedure p1;
     procedure p2;
     end;
     tmyclass=class(tinterfacedobject,imyinterface)
     fmyimplclass:tmyimplclass;
     property myimplclass:tmyimplclass read fmyimplclass implements imyinterface;
     end;
    望解释一下以上声明的含义?
    另外,我想问一下下面类定义的含义,有四个参数,我有点搞不懂? tmyclass=class(tinterfacedobject,ifoo,ibar,igoo)

回答:

    Interface是COM的概念,它很接近于Delphi的类,所以你把它看做一种特殊的类也可以。
    你所看到的tmyclass=class(tinterfacedobject,ifoo,ibar,igoo)中只有第一个是类(父类),其他的都是接口。你可以参考Delphi帮助中的Interface references,它很好地解释了Interface。

此问题由李海回答。

 
把这个问题推荐给朋友
   
   
您的意见类别
您的名字
您的电子邮件
您的建议(请尽可能详细)
 
 

版权所有 1997-2008 热情软件屋
如果您有任何建议和意见, 请给我发个电子邮件 askpro@china-askpro.com
Web Designed by ZebraStudio