各位:    有关 pb 调用 delphi dll 的问题。
    
我用delphi 写了一个dll,我想在pb中调用该dll, pb调用dll的过程中需要向其传送参数,可老是出错。
(具体错误为:应用程序出错  "0x01fda0d"指令引用的"0x0000ccd"内存。该内存不能为“read”..... )请问各位大虾,pb调用delphi dll 注意什末问题??如何解决~?

解决方案 »

  1.   

    delphi 的 dll:
    {library project1;  ..function djdesign(mb:string):Boolean;stdcall;
      begin
         //mainform.Show;
         showmessage(mb);
         result:= true;
      end;  exports
            djprint index 0;}
    pb 中 :
    { declare 中 声明 public Function boolean  djdesign(string mb) library "project1.DLL"在button clicked 事件中 :
    string a
    a = 'aaaa'         
    djdesign(a) }经反复测试发现,有时收到一个字符既'a',有时收到空值, 可能由于参数类型不一致所引起的?!具体怎末解决呢???                                   谢谢告知!!~~~
      

  2.   

    我有写过BCB的参见拙作 http://www.yeqiufeng.net/qfkx4.0/qfsb/bcbdll.htm我感觉你那个函数可能声明有问题 只是感觉至少在BCB中是需要声明为 允许外部调用的@_@
      

  3.   

    可是我在 delphi 中调用没问题!~
                                                      郁闷~~~~
      

  4.   

    你的参数是String类型的,换成Pchar的试试,string类型的参数要加ShareMem的
      

  5.   

    同意楼上的,而且返回值Boolean应该为BOOL,前者是单字节的,PB调用会有问题
      

  6.   

    String 改为pchar,boolean改为integer