C程序: samp1.cpp
int iGlobal = 0
int _stdcall GetGlobalValue()
{return iGlobal}
将C程序编译成obj
delphi 程序:
var Form1:TForm1;
implementation
{$R *.dfm)
{$L Samp1} //here's the inlcude of samp1.obj
function GetGlobalValue:integer;stdcall;external
就可以使用的
关键是{$L filename}
delphi will link the file to exe,this is the static link
the default extension of file is .obj
也是连接静态库的方法