Reading and Writing mpeg File Summary Information
-
Hi, I am trying retrieve summary information of the file. I was using stgOpenStorage API. My code is working only for Word documents and text files. I need this for mpeg,jpeg & wmv files. The following is the code i am using. try { hr = StgOpenStorageEx( L"D:\\Photos\\daffs-768.jpg", STGM_READ|STGM_SHARE_DENY_WRITE , STGFMT_ANY, 0, NULL, NULL, IID_IPropertySetStorage, reinterpret_cast(&pPropSetStg) ); if( FAILED(hr) ) throw L"Failed StgOpenStorageEx"; IUnknown *pUnk = NULL; hr = pPropSetStg->QueryInterface (IID_IUnknown,(void**)&pUnk); hr = pPropSetStg->Open( FMTID_SummaryInformation, STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStg ); if( FAILED(hr) ) throw L"Failed IPropertySetStorage::Open"; // Read the property back and validate it hr = pPropStg->ReadMultiple( 1, &propspec, &propvarRead ); if( FAILED(hr) ) throw L"Failed IPropertyStorage::ReadMultiple"; if( S_FALSE == hr ) throw L"Property didn't exist after reopening the property set"; else { int len = strlen(propvarRead.pszVal); WCHAR* data = new WCHAR[len]; mbstowcs(data,propvarRead.pszVal,len); wprintf(data); delete data; } } catch( const WCHAR *pwszError ) { wprintf( L"Error: %s (hr=%08x)\n", pwszError, hr ); } Please help me how to do this.