Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: RE: Querry.Dll, IFilter and IUnkown and VB: IStorage no problem LOL


Message #1 by "Stuart Naylor" <indtec@e...> on Fri, 7 Feb 2003 15:30:01 -0000
I think my weekends chore is to crack the IStorage Interface of :-

STDAPI BindIFilterFromStorage(
  IStorage * pStg,
  IUnknown * pUnkOuter,
  void ** ppIUnk
);

This I believe can be done; not by me but to quote Issac "...Standing on the
shoulders of giants".
http://www.domaindlx.com/e_morcillo/ Ednamos VB Page probably the most
advanced API VB stuff I have ever seen.
He has created a series of no royality TLBs Type Libararies for VB.
You really need to have a look at OLELIB.TLB - Edanmo's OLE interfaces &
functions v1.61.

I am still unsure about handling the IUnkown interface of the persistant
storage device and that is why I downloaded Ednamos Storage example.

If anyone can help I would really appreciate it.

In return I suggest any VB programmer how is worth there salt and already
doesn't know go onto the Links section at :-
 http://www.vbaccelerator.com and check out some of the code in the advanced
section.
Also I am very interested in chatting about some more of the 'Pro' topics in
this forum rather than reading the many able bodies in this forum answer
questions to novices. LOL.

Seriously API, Win TCP IP and 3rd party tools that need raving about.

Document management is my game but you wide be amazed how far that stretches
my activity zone. I have no problems with if I show you my tips then you
show me yours. I am in good form to day but I am serious about getting some
hardcore VB into this forum.

Stuart


-----Original Message-----
From: Stuart Naylor [mailto:indtec@e...]
Sent: 06 February 2003 07:09
To: professional vb
Subject: [pro_vb] RE: Querry.Dll, IFilter and IUnkown and VB


I forgot to say the methods below are from calling query.dll

say with this :-
STDAPI LoadIFilter(
  WCHAR const * pwcsPath,
  IUnknown * pUnkOuter,
  void ** ppIUnk
);

Parameters
pwcsPath
[in] Pointer to the full path of an object for which an IFilter interface
pointer is to be returned.
pUnkOuter
[in] Pointer to the controlling IUnknown interface of the aggregate in which
this storage object exists.
ppIUnk
[out] Pointer to an output variable that receives the IFilter interface
pointer.

The pointer for the IFilter interface can be done with VB I would obviously
have to move the pointer reference into an object but I guess it is doable
with some head scratching and ide crashes (lol)

The bit that gets me is "Pointer to the controlling IUnknown interface of
the aggregate in which this storage object exists." puzzles the hell out of
me and if someone could expand on that than I would really appreciate it.


-----Original Message-----
From: Stuart Naylor [mailto:indtec@e...]
Sent: 06 February 2003 06:08
To: professional vb
Subject: [pro_vb] Querry.Dll, IFilter and IUnkown and VB


This is my third time trying to work out how the hell you can use IFilters
from VB.

My previous attempts ended in failure so this is hopefully third time lucky
and this is my last chance.

Do any of you guys have any knowledge of IFilter usuage in conjunction with
offfilt.dll and pdffilt.dll (Office and adobe).

Some info is included below if anyone would be so kind. Any Code C or VB
would be of interest.


****************************************************************************
*****************
BindIFilterFromStorage
The BindIFilterFromStorage function takes an IStorage interface pointer of a
structured storage object and retrieves the IFilter interface pointer for
that object in order to filter its text. This is especially useful when
filtering the contents of a document and processing embedded OLE objects
that are accessible through their IStorage interfaces.

STDAPI BindIFilterFromStorage(
  IStorage * pStg,
  IUnknown * pUnkOuter,
  void ** ppIUnk
);
Parameters
pStg
[in] Pointer to the IStorage interface to use to access the file.
pUnkOuter
[in] Pointer to the controlling IUnknown interface of the aggregate in which
this storage object exists.
ppIUnk
[out] Pointer to an output variable that receives the IFilter interface
pointer.
Return Values
S_OK
Successful completion.
E_ACCESSDENIED
The function was denied access to the path of the storage object.
E_HANDLE
The function encountered an invalid handle, probably due to a low-memory
situation.
E_INVALIDARG
The function received an invalid parameter.
E_OUTOFMEMORY
The function did not have sufficient memory or other resources to complete
the operation.
E_FAIL
The function encountered an unknown error.
Remarks
This function is not a full implementation of a COM persistent handler.

Requirements
  Windows 2000 or later: Requires Windows 2000 or later.
  Header: Declared in ntquery.h.
  Import Library: Use ntquery.lib.

See Also
BindIFilterFromStream, IFilter, IStorage, IUnknown, LoadIFilter
****************************************************************************
*****************
Platform SDK: Indexing Service

IFilter
The IFilter interface scans documents for text and properties (also called
attributes). It extracts chunks of text from these documents, filtering out
embedded formatting and retaining information about the position of the
text. It also extracts chunks of values, which are properties of an entire
document or of well-defined parts of a document. IFilter provides the
foundation for building higher-level applications such as document indexers
and application-independent viewers.

For introductory information about how the IFilter interface works with
documents and document properties, see Properties of Documents. For a
synopsis and an example of how the IFilter interface processes a document,
see Property Filtering and Property Indexing.

When to Implement
Implement this interface if you are providing a filter to extract
information from a proprietary file format so that the text and properties
can be included in the index. For information about constructing an IFilter
implementation, see Constructing Filters. For information about registering
a dynamic-link library (DLL) to be called by Indexing Service for the
associated file class, see Applying Filters. For information about testing
your IFilter implementation, see Testing Filters.

When to Use
Full-text search engines like Indexing Service call the methods of this
interface to extract text and property information for creating an index.
Text viewers can also use this interface after a query, for example, to show
the hit highlights for that file.

Indexing Service uses three functions to access registered IFilter
implementations. These functions are especially useful when loading and
binding to an embedded object's IFilter implementation. The functions are:
LoadIFilter, BindIFilterFromStorage, and BindIFilterFromStream.

Methods in Vtable Order
IUnknown methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

IFilter methods Description
Init Initializes a filtering session.
GetChunk Positions filter at beginning of first or next chunk and returns a
descriptor.
GetText Retrieves text from the current chunk.
GetValue Retrieves values from the current chunk.
BindRegion Retrieves an interface representing the specified portion of
object. Currently reserved for future use.


Requirements
  MicrosoftR WindowsR NTR or later: Requires Windows NT 4.0 with the Windows
NT 4.0 Option Pack or Microsoft Windows 2000 or later.
  Header: Declared in filter.h.
  Import Library: User-defined.

Remarks
IFilter components for Indexing Service run in the Local Security context
and should be written to manage buffers and to stack correctly. All string
copies must have explicit checks to guard against buffer overruns. You
should always verify the allocated size of the buffer and test the size of
the data against the size of the buffer.
****************************************************************************
*****************
BindIFilterFromStream
The BindIFilterFromStream function takes an IStream interface pointer of a
Structured Storage object and retrieves the IFilter interface pointer for
that object in order to filter the text of that object. This is especially
useful when filtering the contents of a document and processing embedded OLE
objects accessible through their IStream interfaces.

STDAPI BindIFilterFromStream(
  IStream * pStm,
  IUnknown * pUnkOuter,
  void ** ppIUnk
);
Parameters
pStm
[in] Pointer to the IStream interface to use to access the file.
pUnkOuter
[in] Pointer to the controlling IUnknown interface of the aggregate in which
this stream object exists.
ppIUnk
[out] Pointer to an output variable that receives the IFilter interface
pointer.
Return Values
S_OK
Successful completion.
E_ACCESSDENIED
The function was denied access to the path of the storage object.
E_HANDLE
The function encountered an invalid handle, probably due to a low-memory
situation.
E_INVALIDARG
The function received an invalid parameter.
E_OUTOFMEMORY
The function did not have sufficient memory or other resources to complete
the operation.
E_FAIL
The function encountered an unknown error.
Remarks
This function is not a full implementation of a COM persistent handler.

Requirements
  Windows 2000 or later: Requires Windows 2000 or later.
  Header: Declared in ntquery.h.
  Import Library: Use ntquery.lib.
****************************************************************************
*****************
Platform SDK: Indexing Service

LoadIFilter
The LoadIFilter function takes the path name for an object and retrieves the
IFilter interface pointer on that object in order to filter its text.

STDAPI LoadIFilter(
  WCHAR const * pwcsPath,
  IUnknown * pUnkOuter,
  void ** ppIUnk
);
Parameters
pwcsPath
[in] Pointer to the full path of an object for which an IFilter interface
pointer is to be returned.
pUnkOuter
[in] Pointer to the controlling IUnknown interface of the aggregate in which
this storage object exists.
ppIUnk
[out] Pointer to an output variable that receives the IFilter interface
pointer.
Return Values
S_OK
Successful completion.
E_ACCESSDENIED
The function was denied access to the filter file.
E_HANDLE
The function encountered an invalid handle, probably due to a low-memory
situation.
E_INVALIDARG
The function received an invalid parameter.
E_OUTOFMEMORY
The function did not have sufficient memory or other resources to complete
the operation.
E_FAIL
The function encountered an unknown error.
Remarks
This function is not a full implementation of a COM-persistent handler.

Requirements
  Windows 2000 or later: Requires Windows 2000 or later.
  Header: Declared in ntquery.h.
  Import Library: Use ntquery.lib.

See Also
BindIFilterFromStorage, BindIFilterFromStream, IFilter, IUnknown
****************************************************************************
*****************






  Return to Index