[API]
RtlMoveMemory
GlobalFree
LocalFree

[INCLUDE]
OLEInterface_Release

[DEFINE]
Private Type OLELoadImageIData
  hMemG As Long
  IStream As Long
  IPicture As Long
  End Type
Private Const OLELoadImageIDataLen As Long = 12&

[CODE]
Public Sub OLEFreePicture(ByRef hOlePicture As Long)
  Dim xType1 As OLELoadImageIData
  
  If Not hOlePicture = 0& Then
    Call RtlMoveMemory(xType1, ByVal hOlePicture, OLELoadImageIDataLen)
    Call OLEInterface_Release(xType1.IPicture)
    Call OLEInterface_Release(xType1.IStream)
    Call GlobalFree(xType1.hMemG)
    Call LocalFree(hOlePicture)
    hOlePicture = 0&
    End If
  End Sub