Hi Dear, I am trying to index metadata for doc file for indexing purpose using IFilter implementation. I have the OffFilter.dll which implements IFilter for office documents like .doc etc. I am able to load the filter but the problem is it is only retrieving the contents of the file. I want other data like size of the file etc which it is not returning. Below is the code snippet =============================== CComQIPtr pFilterText; //Initialize the COM LIB if ( FAILED( ::CoInitialize( NULL ) ) ) return ; HRESULT hr; CLSID clsId; IFilter * pFilter; WCHAR * cPath = _T("D:\\Projects\\NBS\\Development items for Oasys post release 1.0.0.46 (RasterX issues).doc"); hr = ::LoadIFilter(cPath, NULL, (void**)&pFilter ); //LoadIFilter uses a means such as CoCreateInstance() to create the filter and then calls IPersistFile::Load with the name of the specified file. if ( FAILED( hr ) ) { return ; } CComQIPtr pPersistFile( pFilter ); SCODE ret = 0; FULLPROPSPEC *fullPropSpec1, *fullPropSpec2; fullPropSpec1 = new FULLPROPSPEC; fullPropSpec2 = new FULLPROPSPEC; GUID guidPropSet = PSGUID_STORAGE; fullPropSpec1->guidPropSet = guidPropSet; fullPropSpec1->psProperty.ulKind = PRSPEC_PROPID; fullPropSpec1->psProperty.propid = PID_STG_CONTENTS ; fullPropSpec2->guidPropSet = guidPropSet; fullPropSpec2->psProperty.ulKind = PRSPEC_PROPID; fullPropSpec2->psProperty.propid = PID_STG_SIZE; FULLPROPSPEC* pArrFPS [] = {fullPropSpec1, fullPropSpec2}; ULONG flags = 0; ULONG grFlags = IFILTER_INIT_CANON_PARAGRAPHS | IFILTER_INIT_APPLY_INDEX_ATTRIBUTES | IFILTER_INIT_HARD_LINE_BREAKS | IFILTER_INIT_CANON_HYPHENS | IFILTER_INIT_CANON_SPACES; sizeof(FULLPROPSPEC); ret = pFilter->Init(grFlags ,2 , *pArrFPS, &flags ); ATLASSERT( SUCCEEDED( ret ) ); STAT_CHUNK statChunk; WCHAR szText[1024] =_T(""); ULONG lLength = 1024; ret = 0; CString str; bool bDone = false; while(1) { size_t s = sizeof(grFlags); ret = pFilter->GetChunk( &statChunk ); if(statChunk.attribute.psProperty.propid == 12) AfxMessageBox("Size retrived"); if(statChunk.attribute.psProperty.propid == 19) AfxMessageBox("Content retrived"); } I doubt I am passing wrong attributes to thr IFilter::Init() function. Can anybody please help me? Let me know if you need more info and a sample project also.
Javed A Ansari Software Developer Hyderabad, India