求助:在Delphi中如何调用C++做的DLL动态链接库???? 在Delphi中如何调用C++做的DLL动态链接库???? 在Delphi中调用Delphi自己编写的DLL动态链接库有何区别???? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不知如何搞,不過我在Delphi5.0開發手冊上看到過如何實現,Delphi 5.0開發手冊Delphi盒子有得下... 有区别吗?输出函数一律用stdcall不就行了 c++的dll:要么做成c接口的(平坦的非类成员函数),要么封成com,要么没辙(标准的c++风格dll)。 找到.h文件,打开。在DELPHI中写一个pas文件.unit CDLL;interfaceconst V1=-1;//常量定义... ...const TWI168FDLL='TWI16_8F.dll'; function D_Installed:integer ; STDCALL; external TWI168FDLL;//函数... ...implementationend. 在implementation以上写上声明。 以下可以调用了。。 VC默认的为__cdecl。对应delphi的cdecl __stdcall stdcall记得要调用方式一致。。 刚写了一个,试了一下,可以。VC源码。新建一个DLL空项目 加个SOURCE文件extern "C" __declspec(dllexport) int add(int a, int b){ return a + b;}DELPHI中新建一个应用程序type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;function add(a: Integer; b: Integer):integer; cdecl; external 'testdll3.dll'implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);begin ShowMessage(inttostr(add(3, 5)));end;end. 求二叉树子节点判断方法(着急等待.......) 有谁用过Delphi写过彩虹天地的 RC-UMH 加密狗的? 有沒有關於 D8書籍? 请大家帮忙 那里能找到Delphi 7.0的打包程序 最好能下载的 超级诡异的问题,打印预览与打印结果不一致! 问题:ADO无法连接SQL SERVER数据库?急盼回复 简单的问题…… 一个关于数据表清空的问题 那里有画矢量图形的控件 送分*** 弟弟病了,还未确诊是否是肺结核,可是非常担心,祝他早日康复,接受大家的祝福,谢谢!--1 高分请教问题!!
要么做成c接口的(平坦的非类成员函数),
要么封成com,
要么没辙(标准的c++风格dll)。
interface
const V1=-1;//常量定义
... ...
const TWI168FDLL='TWI16_8F.dll';
function D_Installed:integer ; STDCALL; external TWI168FDLL;//函数
... ...
implementationend.
以下可以调用了。。
__stdcall stdcall
记得要调用方式一致。。
VC源码。新建一个DLL空项目 加个SOURCE文件
extern "C" __declspec(dllexport) int add(int a, int b)
{
return a + b;
}DELPHI中新建一个应用程序
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;function add(a: Integer; b: Integer):integer; cdecl; external 'testdll3.dll'implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(inttostr(add(3, 5)));
end;end.