我照书做了一个名为ComPlus的COM+组件,并在“控制面板/管理工具/组件服务/”中可以看到。
于是我做客户端程序时,在delphi菜单:project/import type library中选刚写的COM+组件进入工程,
但当我写声明语句:
var my:Icomplus;
时,出下列错误提示:
[Error] Unit1.pas(20): Undeclared identifier: 'Icomplus'
[Fatal Error] Unit1.pas(23): Could not compile used unit 'C:\Program Files\Borland\Delphi6\Imports\ComPlus_TLB.pas'不知哪里出了问题,望高手帮忙指点,万分感激!

解决方案 »

  1.   

    谢谢kuki84() ,另想问一下,之后我调用create老是出错。
    我的语句是:
    my:=tcomplus.create(c);//不知括号中填什么好,老是出下列错误提示:[Error] Unit1.pas(36): Incompatible types: 'TComponent' and 'String'
    [Fatal Error] Project1.dpr(6): Could not compile used unit 'Unit1.pas'而且书上有createRemote函数,但到我写是它就出错,什么做望指点谢谢。
      

  2.   

    tcomplus如果是COClass,Create应该是不要参数的,
      

  3.   

    如果写成my:=cocomplus.create;则是下列错误:
    [Error] Unit1.pas(36): Undeclared identifier: 'cocomplus'
      

  4.   

    create是不用参数的,这个意思为COM+在本地所以不用参数,
    另一个CreateRemote()里面的参数为远程COM+的IP地址,或机器名是个字符串比如本地可以写成
    cocomplus.CreateRemote('127.0.0.1')
    看明白了吧.