ashish wrote:[color=blue]
> We are working on development of an IFilter component for Jpeg and tiff
> files.First ever test resulted in following error. We are using
> ifilttst.exe(which comes with windows 2003 resource kit.) to test the
> filter. Source code snippet has been attached at the end of message. We are
> stuck at this point for the last 5 days and still unable to resolve it.
>
> 380.396 : +TEST+INFO **** Input file : C:\Program Files\Windows Resource
> Kits\Tools\wizard.jpg
> 380.396 : +TEST+INFO **** New configuration ****
> 380.396 : +TEST+INFO Section name : default
> 380.396 : +TEST+INFO grfFlags : 16
> 380.396 : +TEST+INFO cAttributes : 0
> 380.396 : +TEST+INFO aAttributes : NONE
> 380.396 : +TEST+INFO pdwFlags : 0
> 380.396 : +TEST+SEV1 Unable to bind filter to file C:\Program Files\Windows
> Resource Kits\Tools\wizard.jpg Return code is 0x80004005
>
> LOG REPORT---------------------------
> Total Tests : 1
> -------------------------------------
> Tests Passed 0 0%
> Tests Warned 0 0%
> Tests Failed SEV3 0 0%
> Tests Failed SEV2 0 0%
> Tests Failed SEV1 1 100%
> Tests Blocked 0 0%
> Tests Aborted 0 0%
> -------------------------------------
>
> #pragma once
> #include "resource.h" // main symbols
> #include "Filter.h"
> #include "filterr.h"
> #include "ObjIdl.h"
> #include "IPTCLoader.h"
> #include "IPTCJPEGLoader.h"
> #include "IPTCTIFFLoader.h"
>
> // IPTCMetadataIFilter
> [
> coclass,
> threading("free"),
> vi_progid("IPTCIFilterLib.IPTCMetadataIFilter"),
> progid("IPTCIFilterLib.IPTCMetadataIFilter.1"),
> version(1.0),
> uuid("CA7EF3B8-B13E-42A0-8F4A-96970E31ECA3"),
> helpstring("IPTCMetadataIFilter Class")
> ][/color]
The above is a syntax error. The square brackets
'[' and ']' are used to declare an array or an
element within an array. There is no type nor
any variable associated with the brackets.
Also, there is no semicolon, ';', after the
right bracket.
[color=blue]
> class ATL_NO_VTABLE IPTCMetadataIFilter :[/color]
ATL_NO_VTABLE is not a standard token or keyword.
[color=blue]
> public IPersistFile, public IFilter {[/color]
This should be:
class IPTCMetadataIFilter
: public IPersistFile, public IFilter
{
This should have generated some compiler errors.
Are you using the C++ language?
[color=blue]
> public:
> IPTCMetadataIFilter()
> {
> currLoader = NULL;
> jpegLoader = new IPTCJPEGLoader();
> tiffLoader = new IPTCTIFFLoader();
> }[/color]
The above variables are not declared as members in
the above class. They could be globals, but alas,
you have not posted any declaration of them.
[color=blue]
> DECLARE_PROTECT_FINAL_CONSTRUCT()[/color]
What is this?
Function calls are not allowed inside class
declarations.
[color=blue]
> HRESULT FinalConstruct()
> {
> return S_OK;
> }
>
> void FinalRelease()
> {
> }
>
> // IFilter Methods
>
> public:
>
> STDMETHOD_(SCODE, Init)(ULONG grfFlags, ULONG cAttributes,[/color]
Syntax error, unless STDMETHOD_ provides a name after it
is processed by the preprocessor.
[color=blue]
> const FULLPROPSPEC * aAttributes,
> ULONG * pFlags)
> {
> __try[/color]
This is not a a valid identifier in C++.
[color=blue]
> {
> jpegLoader->Initialise(grfFlags,cAttributes,aAttributes);
> tiffLoader->Initialise(grfFlags,cAttributes,aAttributes);
> }[/color]
No declaration of the above variables.
The above variables should be tested for NULL before
they are dereferenced.
[color=blue]
> __except(EXCEPTION_EXECUTE_HANDLER)[/color]
Invalid identifier "__except". Perhaps it is a macro
defined in one of the header files (whose contents you
didn't post).
[color=blue]
>
> {
> return E_FAIL;
> }
>
> return S_OK;
>
> }[/color]
[snip]
Your code doesn't appear to be C++. What compiler
are you using?
Did you post to the correct newsgroup? The FAQ and
Welcome.txt links below provide links to some common
newsgroups.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book