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.
I'm working with the code you provided (making so modifications to fit my purposes). I'm extremely interested in hearing your response to the first issue.
George
Ubi caritas et amor, deus ibi est