General information
Category:
Windows API functions
>Alexander,
>
>I've looked over your code and noted the memory leak problem. I'm interested in knowing how this will resolved. If I understand the documentation on OleCreatePictureIndirect() correctly, there is actually a pointer to an object returned. In order to resolve the problem, the object's Release method needs to be called.
>
>The other thing I've noticed is that you don't call DestroyIcon() to release the icon handles. This may cause a memory leak as well.
Of course, in VFP6 no way to call Release() directly. So we need to find a function for releasing of object. I wanted to play with ReleaseStgMedium() and *pUnkForRelease member in STGMEDIUM structure. I found also a function (forgot it's name), which requires another interface, but calls Release() in all cases, even when a passed interface of wrong type. But I haven't tryed it so far.
About DestroyIcon(). OleCreatePictureIndirect() is called with third parameter fOwn=1. This means that picture (Icon in this case) will be destroyed when the object is destroyed.
Alexander
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only