1。试试将C程序写成DLL给Delphi调用! 2。在DOS下用C语言程序,编译成OBJ文件,离子: 程序: samp1.cpp int iGlobal = 0 int _stdcall GetGlobalValue() {return iGlobal}将C程序编译成objdelphi 程序: var Form1:TForm1;implementation {$R *.dfm) {$L Samp1} //here's the inlcude of samp1.objfunction 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 也是连接静态库的方法//我找到的(·¥·)
2。在DOS下用C语言程序,编译成OBJ文件,离子:
程序: samp1.cpp
int iGlobal = 0
int _stdcall GetGlobalValue()
{return iGlobal}将C程序编译成objdelphi 程序: var Form1:TForm1;implementation
{$R *.dfm) {$L Samp1} //here's the inlcude of samp1.objfunction 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
也是连接静态库的方法//我找到的(·¥·)
TerminateProcess
CloseHandle
能不能使用winexec('c:\abc.exe');]
来通过DELPHI调用C程序?