rainstormmaster的blog
rainstormmaster的blog

Option Explicit
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, source As Any, ByVal numBytes As Long)
Private Declare Sub ZeroMemory Lib "kernel32" Alias "RtlZeroMemory" (dest As Any, ByVal numBytes As Long)

Private Sub CopyStringArray(source() As String, dest() As String)
    Dim mLbound As Long, mUbound As Long, numBytes As Long
    mLbound = LBound(source)
    mUbound = UBound(source)
    numBytes = (mUbound - mLbound + 1) * 4
    ReDim dest(mLbound To mUbound) As String
    CopyMemory ByVal VarPtr(dest(mLbound)), ByVal VarPtr(source(mLbound)), numBytes
End Sub

posted on 2006-01-02 17:38  学剑学诗两不成  阅读(4415)  评论(1编辑  收藏  举报