CSDN博客

img StevenTang

Copy Object by pointer

发表于2004/7/11 20:13:00  567人阅读

Private Sub pvAddRefMe()
Dim oUnk As olelib.IUnknown

   Set oUnk = Me
   oUnk.AddRef
Set oUnk = Nothing

End Sub

Public Function ObjectFromPtr(ByVal lPtr As Long) As Object
Dim oThis As Object

    pvAddRefMe
    CopyMemory oThis, ByVal lPtr, 4&
    Set ObjectFromPtr = oThis
    'CopyMemory oThis, ByVal 0&, 4&
  End Function

0 0

相关博文

我的热门文章

img
取 消
img