IPictureDisp from OleCreatePictureIndirect

S

Shao

I am using VS.Net 2003 and I need to create a IPictureDisp pointer that
points to a picture object.

IPictureDisp *pd;
PICTDESC pdesc;
memset(&pdesc,0,sizeof(pdesc));
pdesc.cbSizeofstruct = sizeof(pdesc);
pdesc.picType = PICTYPE_BITMAP;

pdesc.bmp.hbitmap = static_cast
<HBITMAP>LoadImage(hInst,MAKEINTRESOURCE(resourceID),IMAGE_BITMAP,0,0,LR_LOADMAP3DCOLORS);

pdesc.bmp.hpal = NULL;

HRESULT hr =
OleCreatePictureIndirect(&pdesc,IID_IPictureDisp,TRUE,(void**)&pd);

after this is done "pd" doesn't seem to contain any useful information.
what's wrong here?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top