DLL 中:function PutIndata(s1, s2: Integer ): Boolean; stdcall;
begin
Result := False;
with dm.tbl_test do
begin
try
Open;
Append;
FieldByName('m1').Value := s1;
FieldByName('m2').Value := s2; post;
Close;
Result := True;
except
Result := False;
end;
end;
end;调用:function PutIndata(s1, s2: Integer ): Boolean; stdcall; external '11.dll';procedure TForm1.Button1Click(Sender: TObject);
begin
if PutIndata(1, 1) then ShowMessage('ok')
else ShowMessage('no');
end;
begin
Result := False;
with dm.tbl_test do
begin
try
Open;
Append;
FieldByName('m1').Value := s1;
FieldByName('m2').Value := s2; post;
Close;
Result := True;
except
Result := False;
end;
end;
end;调用:function PutIndata(s1, s2: Integer ): Boolean; stdcall; external '11.dll';procedure TForm1.Button1Click(Sender: TObject);
begin
if PutIndata(1, 1) then ShowMessage('ok')
else ShowMessage('no');
end;
library 11
...export:
PutIndata;
PutIndata;
肯定有的啦,不然怎么调用呢???调用的时候地址出错,不知道是什么原因。。
我快崩溃了出现错误提示"Invalid Pointer Operation"
网友意见:
通过参数(如:App)将主程序的Applicantion对象传递到DLL的函数中,
然后再DLL中设置Application:=App
如何实现。排错阿
应该怎么解决啊。。帮帮手啊
...export
PutIndata;//你输出了吗?begin
end.
就是
exports
我怎么没有看见。
是有的,不然怎么调用呢。
数据库的调用,那么就可以,比如一般的输出 a+b 的值啊。function myadd(a,b:integer):integer;
begin
result:=a+b;
end;
我不太懂,但我愿学