在Delphi中如何调用C++做的DLL动态链接库????  
在Delphi中调用Delphi自己编写的DLL动态链接库有何区别????

解决方案 »

  1.   

    不知如何搞,不過我在Delphi5.0開發手冊上看到過如何實現,Delphi 5.0開發手冊Delphi盒子有得下...
      

  2.   

    有区别吗?输出函数一律用stdcall不就行了
      

  3.   

    c++的dll:
    要么做成c接口的(平坦的非类成员函数),
    要么封成com,
    要么没辙(标准的c++风格dll)。
      

  4.   

    找到.h文件,打开。在DELPHI中写一个pas文件.unit CDLL;
    interface
    const V1=-1;//常量定义
    ... ...
    const TWI168FDLL='TWI16_8F.dll'; 
    function  D_Installed:integer ; STDCALL; external TWI168FDLL;//函数
    ... ...
    implementationend.
      

  5.   

    在implementation以上写上声明。
                    以下可以调用了。。
      

  6.   

    VC默认的为__cdecl。对应delphi的cdecl
              __stdcall    stdcall
    记得要调用方式一致。。
      

  7.   

    刚写了一个,试了一下,可以。
    VC源码。新建一个DLL空项目 加个SOURCE文件
    extern "C" __declspec(dllexport) int add(int a, int b)
    {
      return a + b;
    }DELPHI中新建一个应用程序
    type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;function add(a: Integer; b: Integer):integer; cdecl; external 'testdll3.dll'implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
      ShowMessage(inttostr(add(3, 5)));
    end;end.