Skip to content

Instantly share code, notes, and snippets.

@greatbody
Created January 24, 2019 15:56
Show Gist options
  • Save greatbody/e8754c2a7375597f7f69af0d742e5ee2 to your computer and use it in GitHub Desktop.
Save greatbody/e8754c2a7375597f7f69af0d742e5ee2 to your computer and use it in GitHub Desktop.
VB6使用CopyMemory逐字节设置Long型变量
Private Sub m_SetBytes(ByRef DestValue As Long, ByVal SourceValue As Long, ByVal Offset As Long, ByVal Length As Long)
m_CopyMemory DestValue, SourceValue, Offset, 0, Length
End Sub
Private Sub m_CopyMemory(ByRef DestValue As Long, ByVal SourceValue As Long, ByVal DestOffset As Long, ByVal SourceOffset As Long, ByVal Length As Long)
CopyMemory ByVal VarPtr(DestValue) + DestOffset, ByVal VarPtr(SourceValue) + SourceOffset, Length
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment