有一个用VC写的dll想在delphi中使用,请问怎么导出函数?
例如dll里面有这样一个函数 int f1(char* a,int b,bool c)
还有,下面这些在VC中的数据类型,在delphi中都对应什么呢?
struct structa
{
bool flag;
char    addr[20]
int count;
DWORD mf;
};
这个结构体是int f2(structa& pb)函数的一个参数,因为是引用类型,在delphi中没有引用类型,要怎么办?
帮帮我吧,我是菜鸟。

解决方案 »

  1.   

    1.function f1(a: PChar; b: Integer; c: Boolean): Integer; stdcall; external 'test.dll';2.structa = Record
      flag: Boolean;
      addr: array[0..19] of Char;
      count: Integer;
      mf: LongWord;
    end;3.function f2(var pb: structa): Integer;
      

  2.   

    : ehom  写的完全正确!
      

  3.   

    1.function f1(a: PChar; b: Integer; c: Boolean): Integer; stdcall; external 'test.dll';2.structa = Record
      flag: Boolean;
      addr: array[0..19] of Char;
      count: Integer;
      mf: LongWord;
    end;3.function f2(var pb: structa): Integer;还需注意一定要去分大小写!