Structured Storage API \ File Properties (PIDSI_THUMBNAIL)

 

HI Jason,

please can you tell me where thumbnail is stored?

I need to extract the thumbnail but not with IExtractimage.

Thanks in advance,

best regards

Massimo

 

Posted by: Massimo Magris
Post date: 2/11/2009 6:59:17 AM

6 REPLIES

RE: Structured Storage API \ File Properties (PIDSI_THUMBNAIL)

HI Jason,

 

some more info:

I tried to extract info with this example.

 

http://msdn.microsoft.com/en-us/library/aa379016(VS.85).aspx

Looks like thumbnail is in

 

Property Set {F29F85E0-4FF9-1068-AB91-08002B27B3D9}

(SummaryInformation property set)

in "b.par":

-----------------------------------

PropID = 17 VarType = VT_CF

Value = ...

 

Tried to get the data with (only part of the code):

 

pPropSpec[0].ulKind = PRSPEC_PROPID;

pPropSpec[0].propid = PIDSI_THUMBNAIL;

//pPropSpec[0].propid = 10 ;

 

// Read properties.

hr = pPropStg->ReadMultiple(1, pPropSpec, pPropVar);

if(SUCCEEDED(hr) && pPropVar->vt == VT_CF)

{

pData = pPropVar->pclipdata;

 

// Get the size of the thumbnail

cbSize = pData->cbSize;

 

// Get the format of the thumbnail

cbFormat = pData->ulClipFmt;

 

// Get the data in the thumbnail.

clipType = (DWORD)*pData->pClipData;

 

Thanks, best regards

Massimo

 

Posted by: Massimo Magris
Post date: 2/11/2009 8:21:28 AM

RE: Structured Storage API \ File Properties (PIDSI_THUMBNAIL)

 

Link in SeThumbnail.dll and use the SeThumbnailExtractor coclass.// Generated .IDL file (by the OLE/COM Object Viewer)// // typelib filename: SeThumbnail.dll[ uuid(4F322DC8-10E3-40F4-AA89-4367BA4FA755), version(1.0), helpstring("SeThumbnail 1.0 Type Library"), custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 100663662), custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1218060825), custom(DE77BA65-517C-11D1-A2DA-0000F8773CE9, "Created by MIDL version 6.00.0366 at Wed Aug 06 17:13:44 2008")]library SeThumbnailLib{ // TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046} importlib("stdole2.tlb"); // Forward declare all types defined in this typelib interface ISeThumbnailExtractor; [ uuid(D5E1D8F7-7570-490B-93A4-3B106BAB13AD), helpstring("Sold Edge Thumbnail Server") ] coclass SeThumbnailExtractor { [default] interface ISeThumbnailExtractor; }; [ odl, uuid(AC064B8B-E1E3-4287-B103-1441B8D8BAB4), helpstring("ISeThumbnailExtractor Interface"), dual, oleautomation ] interface ISeThumbnailExtractor : IDispatch { [id(0x00000001), helpstring("method GetThumbnail")] HRESULT GetThumbnail( [in] BSTR File, [out] int* hBitmap, [in, optional] VARIANT bSquetch); };};

 

Posted by: Jason Newell
Post date: 2/11/2009 10:45:18 AM

RE: Structured Storage API \ File Properties (PIDSI_THUMBNAIL)

 

Jason,

thank you.

So it's not possible to extract the thumbnail without the DLL?

It is possible to redistribute the dll to PC that doesnt have SolidEdge installed?

Thanks

Regards

Massimo

 

Posted by: Massimo Magris
Post date: 2/11/2009 10:52:26 AM

RE: Structured Storage API \ File Properties (PIDSI_THUMBNAIL)

 

Massimo,

 

I seriously doubt that it would be legal to distribute the .dll. I have not ever taken the time to try and find it in the structured storage api. There is really no way of knowing exactly how they store or generate the thumbnail. i.e. They may not store it at all but rather generate it. It's really hard to say.

I also want to point out that IExtractimage will fail on a system that does not have Solid Edge installed.  The OS defers to the Solid Edge API to get the actual thumbnail, I believe through the SeThumbnail.dll.

I'll poke around and see what I can come up with.

 

Posted by: Jason Newell
Post date: 2/11/2009 10:56:21 AM

RE: Structured Storage API \ File Properties (PIDSI_THUMBNAIL)

 

Massimo,

Using Compound File Explorer, I think that I may have found where they store the thumbnail.  I don't have time right this second to try and write the code but I thought I'd at least show you what I found.  See attachment.

I've also written the code to get the CLIPDATA pointer from the PIDSI_THUMBNAIL but I always end up with no data.

WTypes.h defines:typedef struct tagCLIPDATA { ULONG cbSize; long ulClipFmt; BYTE *pClipData; } CLIPDATA;// Macro to calculate the size of the above pClipData#define CBPCLIPDATA(clipdata) ( (clipdata).cbSize - sizeof((clipdata).ulClipFmt) )

So when I call CBPCLIPDATA, I get 0 for the PIDSI_THUMBNAIL.  I'm thinking that if we go to the other stream and get the "Small DIB", we'll get what we're looking for.

 

Posted by: Jason Newell
Post date: 2/13/2009 9:28:04 AM

RE: Structured Storage API \ File Properties (PIDSI_THUMBNAIL)

 

Jason,

Thank you, great info.

I will try to extract the thumbnail. It can be very useful for writing application that show preview of solidedge data

without SE installed.

ciao

Massimo

 

Posted by: Massimo Magris
Post date: 2/13/2009 11:51:36 AM