dim a(1000) as long
dim b(4000) as byte
dim c(2000) as integerfill some data to acopymemory b(0),a(0),4000
copymemory c(0),a(0),4000这样拷贝的数据不正确,为何?另外,我家里的winme(cn)+vb6(en)+sp5使用copymemory函数没有问题
可是单位的机器w2k pro(cn)+vb6(en)+sp5在IDE解释执行出错,编译后没有问题,请问是什么原因?谢谢!
dim b(4000) as byte
dim c(2000) as integerfill some data to acopymemory b(0),a(0),4000
copymemory c(0),a(0),4000这样拷贝的数据不正确,为何?另外,我家里的winme(cn)+vb6(en)+sp5使用copymemory函数没有问题
可是单位的机器w2k pro(cn)+vb6(en)+sp5在IDE解释执行出错,编译后没有问题,请问是什么原因?谢谢!
Private Const conSOUR As Integer = 260
Private Const conDEST As Integer = 1040Private Sub Form_Load()
Dim strFileName As String
Debug.Assert conDEST = 4 * conSOUR
strFileName = "D:\Documents and Settings\Zq\桌面\CopyMemory.txt"
m_intFileNum = FreeFile
Open strFileName For Output As #m_intFileNum
Dim i As Long
Dim a(conSOUR - 1) As Long
Dim b(conDEST - 1) As Byte
For i = 0 To conSOUR - 1
a(i) = i
Next i
For i = 0 To conDEST - 1
If b(i) <> 0 Then
Debug.Assert False
End If
Next i
CopyMemory b(0), a(0), conDEST
For i = 0 To conDEST - 1
If b(i) <> 0 Then
DebugToFile "b(" & i & ")=" & b(i)
End If
Next i
'关闭文件
Close #m_intFileNum
Unload Me
End Sub'输出调试信息到文件
Private Sub DebugToFile(ByVal strText As String)
Print #m_intFileNum, strText
End Sub
我是这样初始化字符串的
dim s as string
dim a(1000) as longs=strconv(string(4000,chr(0)),vbfromunicode)
copymemory byval s,a(0),4000可是这样出来的数据不对,请问怎样解决?谢谢!!
http://www.csdn.net/develop/read_article.asp?id=13065
我把copy过的字符串序列输出看过,应该是高低字节排列问题,请问有什么好的方法解决??
谢谢!