关注!
难怪。NET把VB改得面目全非了!

解决方案 »

  1.   

    1.Use lstrcpy/memcpy API
    Public Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (lpDest As Any, lpSource As Any) As Long dim strDest as string
    strDest= space(255)
    lstrcpy Byval strDest,Byval nPtrSource 'nPtrSource is pointer to source string   .......2.Try to use valPtr function or use HeapAlloc Api to get address. 
      

  2.   

    sorry, but the length of the string return by API is UNKNOWN!
    and it may be too long to alloc a new space for it!
    the way i want is to reuse the address return by the call! not just copy it.what a pity!
      

  3.   

    You can use lstrlen function to retieve a length of string. 
      

  4.   

    but i think the best way is not to copy another copy of the string!
    that need too many memory.
    do you have any other method?
      

  5.   

    You see ,the string in vb is of  BSTR type,you cannot use null-terminate string in vb direct.I don't think the memory of a string is big problem.
    As for the second question, the parameter char **ptr is a in para or an out para?