I´ve been on a long quest for answer til now (posted this question in round about 6 sites like this but got not a single reply!!) - so hopefully someone can help me here!
(And by the way - i don´t belive that my question is that difficult to answer...)
So what is my problem:
If got an ActiveX-Control where i implemented a Picture-Property. The bitmap is stored in a CPictureHolder (m_Picture). I want to create a Pattern-Brush from this to fill the background of the control.
So the problem is how to get a HBITMAP-handle for the CreatePatternBrush-function, because get_Handle returns only an OLE_HANDLE.
I´ve tried it this way:
// CDrawPicCtrl::OnDraw - Drawing function
void CDrawPicCtrl::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
static HBRUSH PatternBrush=NULL;
if ((PatternBrush==NULL)&(PICTYPE_BITMAP == m_Picture.GetType()))
m_Picture.m_pPict->get_Handle((OLE_HANDLE FAR *) &hBitmap);
This didn´t work so I also tried it this way:
Either way i tried i didnt´t get a valid HBITMAP-handle.
I´m really desperate - can´t belive that i can´t make that sh... work!!!
I´m using VC++ 6 and Win98.
If you need more information please ask!
Thanks a lot!