在窗口上放了两个控件 TComponentA, TComponentBTComponentB.GetAInterface 是一个返回 IInterface 的函数我想用 TComponentA.ConnectTo 连接这个IInterface
不过 ConnectTo 参数是 IA, 跟IInterface 不搭配, 所以编译报错至于这个ConnectTo是不是可以这样用我也不是很清楚 因为我似乎找不到可以搭配的函数了请各位大侠指点, 小弟感激不尽!! ^_^

解决方案 »

  1.   

    我的意思就是说
    TComponentB 中能够用GetAInterface返回一个 IAInterface (就是上面的 IA)
    而TComponentA 本来就是拥有 IA 的一个Component,能够用这个IA进行自己的操作现在就是要从TComponentB中获取这个IA 付到 TComponentA中怎么办呢
      

  2.   

    Typically, you connect to a server through its main interface. For example, you would connect to Microsoft Word through the WordApplication component. Once youe connected to the main interface, you can connect to any of the application components (such as a WordDocument or WordParagraphFormat) by using the ConnectTo method.
      

  3.   

    var
      aintf:IA;
    ................
      aintf:=ComponentB.GetAInterface as IA;
      ComponentA.ConnectTo(aintf);
    楼主要的,差不多是这样吧??
      

  4.   

    to: halfdream(哈欠)
    我猜楼主是这个意思楼主找些Com方面的资料来看吧
      

  5.   

    多谢各位
    现在已经连接上了 就是用connectto 好象可以
    不过有时候不知道为什么会出错是不是connectto以后一定要 disconnect呢?