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. COM
  4. Property Storage(Persistance)(need urgent)

Property Storage(Persistance)(need urgent)

Scheduled Pinned Locked Moved COM
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.
  • P Offline
    P Offline
    Pankaj Mongia
    wrote on last edited by
    #1

    I have to read and write on the contents tab(which appears when u rigth click on any word file and select the properties).i am able to read and write rest all the tabs like (General,Summary,Statstic and custom) but not on contents. I am using IPropertySetStorage. the code i am using is given below please suggest some solution.........its urgent the code i am using is described below #define UNICODE #define _UNICODE #define WIN32_LEAN_AND_MEAN #define UNICODE #define _UNICODE #include #include #include #include // Implicitly link ole32.dll #pragma comment( lib, "ole32.lib" ) #include // From uuidgen.exe: //b725f130-47ef-101a-a5f1-02608c9eebac //79c1e210-9ad8-11d5-ae31-000102572d6d /*const FMTID fmtid = { /* d170df2e-1117-11d2-aa01-00805ffe11b8 0xd170df2e, 0x1117, 0x11d2, {0xaa, 0x01, 0x00, 0x80, 0x5f, 0xfe, 0x11, 0xb8} };*/ const FMTID fmtid = { /* d170df2e-1117-11d2-aa01-00805ffe11b8 */ 0xb725f130, 0x47ef, 0x101a, {0xa5, 0xf1, 0x02, 0x60, 0x8c, 0x9e, 0xeb, 0xac} }; EXTERN_C void wmain() { HRESULT hr = S_OK; IPropertySetStorage *pPropSetStg=NULL,*pPropSetStg1=NULL; IPropertyStorage *pPropStg = NULL,*pPropStg1 = NULL; WCHAR *pwszError = L""; LPSTORAGE pFileStorage = NULL; PROPVARIANT propvarWrite, propvarWrite1; PROPSPEC propspec; try { // Create a file and a property set within it. hr = StgCreateDocfile( L"d:\\temp\\WriteRead.doc", STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &pFileStorage); if( FAILED(hr) ) return ;//throw L"Failed StgCreateStorageEx"; /*//#CHNG rajeev LPSTORAGE pStorage; hr = pFileStorage->CreateStorage( L"\005MyStorage", STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, 0, &pStorage); LPSTREAM pStream1; hr = pFileStorage->CreateStream( L"\005MyStream", STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, 0, &pStream1); if ( FAILED(hr)) return; CComBSTR ab("\005abcd"); unsigned long count; pStream1->Write(ab,ab.Length(),&count); */ // //#CHNG rajeev*/ //FMTID_DocSummaryInformation //for the summary coc //FMTID_UserDefinedProperties pFileStorage->QueryInterface(IID_IPropertySetStorage,(void **) &pPropSetStg1); hr = pPropSetStg1->Create( FMTID_SummaryInformation, NULL, PROPSETFLAG_DEFAULT , STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE, &pPropStg1 ); propspec.ulKind = PRSPEC_PROPID; propspec.propid = 0x000000002; PropVariantInit( &propvarWrite1 ); propvarWrite.vt = VT_LPWSTR; propvarWrite.pwszVal = L"abc"; hr = pPropStg1->WriteMultiple( 1, &propspec, &pr

    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