Thanks a lot! I'm trying to use the GetPicture() function, I create a CPicture1, but I don't know how to get a CBitmap from it. How can I do?
Once you get a pointer to IPictureDisp via a call to GetPicture(), you can obtain a GDI handle of the picture invoking DISPATCH_PROPERTYGET with DISPID_PICT_HANDLE (0). Just like this:
COleVariant res; //or CComVariant, if using ATL
DISPPARAMS noArgs = {NULL, NULL, 0, 0};
hr = picture->Invoke(DISPID_PICT_HANDLE, IID_NULL,
LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET,
&noArgs, &res, NULL, NULL);
if (SUCCEEDED(hr))
{
// you might want to copy HBITMAP
// to you CBitmap instance
}
To make code cleaner, you can use helper classes from MFC/ATL, such as CComDispatchDriver (which calls Invoke for you).
For more, please read http://msdn2.microsoft.com/en-us/library/ms680761.aspx