1.copymemory
2.put #1,,arraytemp

解决方案 »

  1.   

    楼上的朋友能不能将 copymemory 的用法给个实例呢?谢谢!
      

  2.   

    Private Function BSTRtoLPSTR(sBSTR As String, b() As Byte, lpsz As Long) As Long
      Dim cBytes As Long
      'Get the number of bytes in the string
      cBytes = LenB(sBSTR)
      
      'Redim the array to hold it + 2 for Unicode null
      ReDim b(1 To cBytes + 2) As Byte
      
      Dim sABSTR As String
      'Set sABSTR to ASCII equivalent
      sABSTR = StrConv(sBSTR, vbFromUnicode)
      
      'Get a long pointer to the string
      lpsz = StrPtr(sABSTR)
      
      CopyMemory b(1), ByVal lpsz, cBytes + 2
      
      lpsz = VarPtr(b(1))
      
      BSTRtoLPSTR = cBytesEnd Function
      

  3.   

    当程序运行到  CopyMemory b(1), ByVal lpsz, cBytes + 2
    时,提示“子程序或函数没有定义”的错误啊!请问如何引用?
      

  4.   

    http://www.csdn.net/expert/topic/770/770289.xml?temp=.7491571
      

  5.   

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

  6.   

    为什么要用API呢,VB自己不是可以读写二进制文件吗,而且速度并不慢,何必要把简单的事弄复杂呢!!!!!!
      

  7.   

    他读出来的是一个指向数据的指针,若定义一个char*的变量则可以读出来的是
    字符串
    HFILE file;
    char* c=NULL;
    file=_lopen("name",0);
    c=_lread(file,"读入的指针",数据块的大小");