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;

解决方案 »

  1.   

    什么意思?DLL中可以实现呀!
      

  2.   


    library 11
    ...export:
      PutIndata;
      

  3.   

    export:
      PutIndata;
    肯定有的啦,不然怎么调用呢???调用的时候地址出错,不知道是什么原因。。
      

  4.   

    又是dll阿,
    我快崩溃了出现错误提示"Invalid Pointer Operation"
    网友意见:
    通过参数(如:App)将主程序的Applicantion对象传递到DLL的函数中,
    然后再DLL中设置Application:=App
    如何实现。排错阿
      

  5.   

    错误提示:Access violation at address 002B2751 in module '11.dll'. Read of address 0000005C.
    应该怎么解决啊。。帮帮手啊
      

  6.   

    错误提示:Access violation at address 002B2751 in module '11.dll'. Read of address 0000005C.
      

  7.   

    Library 11
    ...export
      PutIndata;//你输出了吗?begin
    end.
      

  8.   

    to   yoic(我是一棵菠菜,菜,菜,菜,菜,菜,菜,) ( 这些有的啦,,,,,up.................
      

  9.   

    你的dll的输出点列
    就是
    exports
    我怎么没有看见。
      

  10.   

    exports
    是有的,不然怎么调用呢。
      

  11.   

    如果不是with dm.tbl_test do
      数据库的调用,那么就可以,比如一般的输出 a+b 的值啊。function myadd(a,b:integer):integer;
    begin
      result:=a+b;
    end;
      

  12.   

    exports是要对每一个函都有的吧,
    我不太懂,但我愿学