高分酬谢!

解决方案 »

  1.   

    比如你的DLL函数这样定义
    Declear PPP(ByVal Addr as long)
    那么你这么调用:
    dim S as string
    PPP(addressof s)
      

  2.   

    你可以用API函数copymemory将地址中的内容拷贝到VB字符串中。
      

  3.   

    Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long
      

  4.   

    Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
    少了个括号其实是相同的指针,只是String的前几个字节保存了字符串长度的信息
      

  5.   

    viena(维也纳nn-实心木头人) ,偶吐你一身哎。
    注意楼主说的是地址啊。CopyMemory 在哪个位置输入地址啊?
    还是偶说的方法才是管用的。
      

  6.   

    to samwzhang(分全给我)
    说的就是地址啊,指针不是地址吗?"字符串首地址"我理解就是指向字符串的指针,就是CopyMemory的Source参数;而String本身也是指针,作为Destination参数
      

  7.   

    偶晕倒哎
    偶把问题说说清楚吧:
    所谓地址,就是个Long型
    比如说是:12345678吧。
    要接收的字符串:S
    你用CopyMemory写下命令格式给偶看看。
      

  8.   

    这样说吧:
    C里边的字符串:Char *CC;
    传出来的函数:PPP(&CC)注意:&CC已经是个地址了,也就是个整型了。VB里边接收,收到这个长整数,记为L。
    要求转成字符串:S — 要是原来的CC哦。
    你来写下CopyMemory的命令格式。
      

  9.   

    sorry,函数声明中默认是byRef的,应该改成ByVal的就对了
    Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal Destination As Any,ByVal Source As Any, ByVal Length As Long)
      

  10.   

    我是说,你写下命令格式
    比如:CopyMemory S,12345678,100
    然后自己看看什么结果