Solved

The type or namespace Ifilter could not be found

Posted on 2006-06-23
9
798 Views
Last Modified: 2012-06-27
Hello,

I am trying to compile this code in C# 1.1:

using System;
using System.Runtime.InteropServices;
using System.Text;



namespace DesktopSearch1.Parsing
{
    /// <summary>
    /// Summary description for Parser.
    /// </summary>
    public class Parser
    {
        public Parser()
        {
        }

        [DllImport("query.dll", CharSet = CharSet.Unicode)]
        private extern static int LoadIFilter(string pwcsPath, ref IUnknown pUnkOuter, ref IFilter ppIUnk);

..... the rest has been ommited

When i try to compile, it says that "the type or namespace 'IFilter' could not be found" -- does anyone know how to get rid of this error?

Thanks
0
Comment
Question by:alexthecodepoet
  • 5
  • 4
9 Comments
 
LVL 25

Expert Comment

by:dstanley9
ID: 16972265
Where is the defenition for IFilter?  Is it in query.dll?  Is query.dll a COM dll?  If so, why are you using pinvoke?
0
 

Author Comment

by:alexthecodepoet
ID: 16972279
IFilter microsoft .NET technology..
to be honest, i dont know where the definition is, that is what i was hoping to find out ;)
0
 
LVL 25

Expert Comment

by:dstanley9
ID: 16972350
OK, found this function at pinvoke.net, which is a little different from yours:

[DllImport("query.dll", SetLastError=true, CharSet=CharSet.Unicode)]
static extern int LoadIFilter(string pwcsPath,
          [MarshalAs(UnmanagedType.IUnknown)] object pUnkOuter,
          ref IFilter ppIUnk);

IFilter is a COM intefacce, so you may have to define it yourself.  Here's some source that I found:

http://dotlucene.net/documentation/MicrosoftOfficeDocumentsP.html

0
 

Author Comment

by:alexthecodepoet
ID: 16972602
when i do that, and then try to compile, i get this error that says 'receieved a namespace instead of a class' ... or something..

i copied the code from the dotlucene page, put it into IFilter.cs, compiled it, and then referenced that dll file from Parser.cs (and i get the error above)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 25

Expert Comment

by:dstanley9
ID: 16972623
Well, the jerk names the namespace the same as the interface.  For clarity, change the namespace in ifilter.cs to IFilterInterop and add

using IFilterInterop

to Parser.cs
0
 

Author Comment

by:alexthecodepoet
ID: 16972738
are you going to be here for a few more minutes?  There are little bugs popping up that i am trying to fix
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 16972745
yep.
0
 

Author Comment

by:alexthecodepoet
ID: 16972761
if we can fix this, give me your address, and i might send you 99 trillion dollars (thats how happy i would be)

I now get this one and only error:

the type or namespace name 'constants' could not be found (are you missing a using directive or an assembly reference?)
0
 

Author Comment

by:alexthecodepoet
ID: 16972924
i ended up using a different IFilter.cs file, and now it works.

thanks for all of the help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now