Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
            (lpDest As Any, lpSource As Any, ByVal nCount As Long)

Private Sub Form_Load()
    Dim c As New clsTest
    c.Name = "Hello,World!"
    
    Dim addr As Long
    addr = ObjPtr(c)
    
    Dim c2 As clsTest
    CopyMemory c2, addr, 4

    MsgBox c2.Name
    c2.Name = "haha"

    CopyMemory c2, 0&, 4
End Sub

 

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-13
  • 2021-07-03
  • 2021-08-03
  • 2022-12-23
相关资源
相似解决方案