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
P

Pankaj Mongia

@Pankaj Mongia
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Property Storage(Persistance)(need urgent)
    P Pankaj Mongia

    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

    COM

  • what happen to my <string> please?
    P Pankaj Mongia

    i think u r taking in wrong way. 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......... ;) Pankaj Mongia

    C / C++ / MFC

  • property storage(persistance)
    P Pankaj Mongia

    i am facing one problem, i have to access the data of contents tab of property sheet by VC through property storage. i suppose it should be part of Docsummaryinformation, i am using that but not able to write or read the contents tab information so if u can suggest any thing thats good. 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_IPropertySetStorag

    C / C++ / MFC
  • Login

  • Don't have an account? Register

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