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.
Sivaji
Posts
-
Reading and Writing mpeg File Summary Information -
MFC's TreeCtrl customizationHi everyone! I want to customize MFC's CTreeCtrl. I need to place a command button for the parent items(side to the text) and a progress bar(side to the text) for the child items. Is this possible by extending CTreeCtrl? If possible please give an idea. otherwise please give the alternative ways to do this. Thanks, Sivaji Reddy
-
problem with STL VectorI am declaring a vector variable vectorm_RemoteInfo; If try to use this another class(CIWAPT5Socket) it's giving invalid indirection.why?? Here is the class code i am referring ((CIWAPT5Dlg*)m_Dlg)->pSocket = new CIWAPT5Socket(m_Dlg); if(Accept(*((CIWAPT5Dlg*)m_Dlg)->pSocket)) { LocalServerInfo *m_info; *((CIWAPT5Dlg*)m_Dlg)->m_RemoteInfo->push_back(m_info); MessageBox(NULL,"Connection Accepted","IWAPT5 Server",MB_OK; }
-
Hey problem with STL VectorI am declaring a vector variable vectorm_RemoteInfo; If try to use this another class(CIWAPT5Socket) it's giving invalid indirection.why?? Here is the class code i am referring ((CIWAPT5Dlg*)m_Dlg)->pSocket = new CIWAPT5Socket(m_Dlg); if(Accept(*((CIWAPT5Dlg*)m_Dlg)->pSocket)) { LocalServerInfo *m_info; *((CIWAPT5Dlg*)m_Dlg)->m_RemoteInfo->push_back(m_info); MessageBox(NULL,"Connection Accepted","IWAPT5 Server",MB_OK; }
-
How to remove context menu created from taskbar ?Ru using TrackpopUpMenu() function call or u r using u r own customised function? If u r using TrackPopupMenu() call once u chech hwnd parameter.
-
how to find the length or Time of the WAV file will be played using VC++Hi it's very simple. Total Length of Play=Toatal No of samples/Sampling rate sec
-
Connecting to multiple servers thru single port client connectionHey i am using CSocket class in MFC. My program(client) should connect to multiple servers. I am using single port at client to connect.It's connecting to the first server successfully.For second server while connecting it's failing. The error code it's returning is 0x00002748. What's the meaning of this error code. Is it possible to connect from the same port to multiple servers.If possible pls help me.Is there any problem with CSocket class?? Thanks
-
UTF8 to Unicode conversionHi I am reading text from UTF8 text file. I want to convert text to unicode to display in textbox.Pls help anyone ASAP. Thanks
-
Writing editors for indian languagesI can use.But any process is same. I am writing editor to type with help of english keyboards. that's why i have map ascii to corresponding font or unicode then i have to display. I am tracking kbinputs with onchar and storing as unicode in an array.i am displaying that with setwindowtext.i am trying move the caret that's not moving.it's at the starting pos only anyway thanks
-
Writing editors for indian languageshello friends! I am writing an editor for indian languages using Unicode.for this what i am doing is 1.i choosen mfc appwizard in vc 2.i am overriding onchar method for view class(CEditView) 3.i am setting the text to window using setwindowtext fn 4.i am not getting when coming to next line it is not coming and i am not able to get the caret to the end of text pls any of u can help thanks in advance
-
How to TURN UNICODE ON.for that u have to change settings. step1: go to project->settings->c/c++->cateogery in that select preprocessor. in preprocessor defnitions txt box _MBCS to _UNICODE step2: in link tab goto category.select output. in entry point textbox write this 'wWinMainCRTStartup' Thats all.
-
Playing wav through streaming bufferhello friends! i am wanted write a program that plays wav's continuously. i am preparing header for each and playing.due to that in between the wav files i am getting break.for that is it possible to prepareheader at first and then passing data to the buffer(streaming like).If possible pls help me ASAP. Thanks in advance
-
_BLOCK_TYPE_IS_VALID assert statement with vectorhello friends! i am using vector in my program.when i trying push back the elements it's giving assert failure _BLOCK_TYPE_IS_VALID statement. how to resolve this problem.
-
can we add wave files as resourceThank u Monty. OK.