Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

The type or namespace Ifilter could not be found

Posted on 2006-06-23
9
Medium Priority
?
809 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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
 
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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

688 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