请教:DELPHI怎么调用C程序,又怎么关闭C程序?

解决方案 »

  1.   

    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.   

    CreateProcess
    TerminateProcess
    CloseHandle
      

  3.   

    没有这么复杂吧?
    能不能使用winexec('c:\abc.exe');]
    来通过DELPHI调用C程序?