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. Problem while using IFilter for indexing

Problem while using IFilter for indexing

Scheduled Pinned Locked Moved C / C++ / MFC
helpdatabasecomquestionannouncement
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.
  • J Offline
    J Offline
    Javed Akhtar Ansari
    wrote on last edited by
    #1

    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

    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