我写了个DLL有个函数,function testpchar(a:longint;c:longint;b:pchar):integer;
现在要将值写入a,b,返回给调用者pchar型的我可以通过strcopy赋值返回没问题,
请问logint(integer)型如何赋值啊?

解决方案 »

  1.   

    var    a,c:longint 
      

  2.   

    function testpchar(var a:longint;c:longint;b:pchar):integer;
    调用时:
    var
      a,c:longint;
    begin
      testpchar(a,c,b);(函数中赋值)
    执行完 a,c为返回的
      

  3.   

    楼上说的方法,在delphi中调用是没有一点问题的,但其语言中就有问题了,比如VC中,b我就得strcopy才可以回传成功
      

  4.   

    用指针就行了 PIntegerPChar不也是指针么 一个道理
      

  5.   

    pinteger如何赋值呢,有代码么?
      

  6.   

    示例
    vc动态调用
    typedef int(CALLBACK* testpchar_)(DWORD *aaa,char *bbbbb );
    .......delphi定义
    function testpchar(a:pinteger;b:pchar):integer;
    begin
    a^:=1234567;
    Result:=9000;
    end;