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

ssoft 2003-10-18 08:56:30
请教:DELPHI怎么调用C程序,又怎么关闭C程序?
...全文
59 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hiflower 2003-10-18
  • 打赏
  • 举报
回复
CreateProcess
TerminateProcess
CloseHandle
dickeybird888 2003-10-18
  • 打赏
  • 举报
回复
1。试试将C程序写成DLL给Delphi调用!
2。在DOS下用C语言程序,编译成OBJ文件,离子:
程序: 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
也是连接静态库的方法

//我找到的(·¥·)
ssoft 2003-10-18
  • 打赏
  • 举报
回复
没有这么复杂吧?
能不能使用winexec('c:\abc.exe');]
来通过DELPHI调用C程序?

5,379

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧