Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

Picture Sample (C++)

This sample illustrates working with pictures.

This is not an executable sample, so a complete project is not provided. These statements are intended to show the syntax used.

ISftDirectoryPtr vDir1 = m_Dir1.GetControlUnknown();
IPictureDispPtr pIPictureDisp;
PICTDESC PictDesc;
PictDesc.cbSizeofstruct = sizeof(PICTDESC);
PictDesc.picType = PICTYPE_BITMAP;
PictDesc.bmp.hbitmap = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_A_16x16_BITMAP));
ASSERT(PictDesc.bmp.hbitmap);
PictDesc.bmp.hpal = NULL;
HRESULT hr = OleCreatePictureIndirect(&PictDesc, IID_IPictureDisp, TRUE, (void**)&pIPictureDisp);
ASSERT(SUCCEEDED(hr));
vDir1->CurrentFolder->put_Picture(pIPictureDisp);

Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.