Memory leak while using emoticons on CRichEditCtrl
- by Jorg B Jorge
I'm developing a text editor class (for a chat application) based on CRichEditCtrl (MFC) with emoticon support.
After i load the emoticon's bitmap, I use the function OleCreateStaticFromData to insert it into CRichEditCtrl. After that i just delete the bitmap object allocated by myself. I can verify (using a GDIView utility) that all resources i allocate have been properly released.
This works perfectly: the bitmap (emoticon) is drawn on the CRichEditCtrl window and is handled just like a character.
My problem is that I don't know how to deallocate the memory (internal) allocated by OleCreateStaticFromData to manage the bitmap (emoticon). The memory allocated for any emoticon used is never released, even if i delete the CRichEditCtrl object. I'd like to know how to fix that issue. Is that a MFC's issue or i'm doing something wrong ?
Thx.