//============不知在其它工程中如何调用=============
//=================================================
//======新建工程名为:Project1=====================library Project1;uses ... ...;{$R *.res}exportsCreate index 1,
Destory index 7;begin
end.//=================================================
//======函数单元这在这里,就2个而已================unit TTSDLL;interface
uses VtxtAuto_TLB;procedure Create;export; {待导出的过程和函数}
procedure Destory;export;var
  TTS: IVTxtauto;implementationprocedure Create;
begin
  TTS:=CoVTxtAuto_.Create; {创建对象}
  TTS.Register('Project1','Project1'); {注册 }
end;procedure Destory;
begin
  TTS:=nil;{释放对象}
end;end.
//================完===编译通过====================
//============不知如何在其它工程中调用=============

解决方案 »

  1.   

    library mydll;uses
      SysUtils,
      Classes,
      windows;{$R *.res}function max(i,j: integer):integer; stdcall; export;
    begin
      if i > j then result:= i else result:= j;
    end;exports
    max;begin
    end.
    编译后生成dll文件。
    ========================
    调用工程里
    function max(i,j: integer):integer; external 'mydll.dll' name 'max';
      

  2.   

    //============不知如何在其它工程中调用=============
    procedure create;external 'project1.dll';
    procedure destoty;external 'project1.dll'
      

  3.   

    先多谢两位:xixuemao(俺可是㊣②㈧经儿滴人) &  zhaozhen2004(圣骑士) 一般的函数我会用,可上面代码我是想在其它工程中调用“TTS”啊。
    申明的tts是IVTxtauto,调用时要怎样搞?
      

  4.   

    那我就不明白了,你仅仅把创建和释放IVTxtauto的代码放到dll里面有什么意义呢?
      

  5.   

    在调用是也要引用  VtxtAuto_TLB