Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Reading and Writing mpeg File Summary Information

Reading and Writing mpeg File Summary Information

Scheduled Pinned Locked Moved C / C++ / MFC
helpjsontutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sivaji
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups