查看: 17  |  回复: 0
  VB6 CopyMemory不会导致崩溃,测试:复制1000个字节,1亿次一会儿就完成
楼主
发表于 昨天 18:21

新建From1(窗体),新建Command1(按钮CommandButton),代码:

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pTo As Any, uFrom As Any, ByVal lSize As Long)

Private Sub Command1_Click()
    Dim i&, arrA(999) As Byte, arrB(999) As Byte
        
    For i = 0 To 99999999
        CopyMemory arrA(0), arrB(0), 1000
    Next
    
    MsgBox "完成"
End Sub


您需要登录后才可以回帖 登录 | 立即注册
【本版规则】请勿发表违反国家法律的内容,否则会被冻结账号和删贴。
用户名: 立即注册
密码:
2020-2025 MaNongKu.com