473,706 Members | 6,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Desktop Search IDL with C#

I'm trying to use the IDL that's part of the Desktop search API in my C#
application. I'm having problems getting things to work. Can anyone point
me in the right direction for using IDL files with C#?

The other problem is I tried including it in a basic C++ app using the 2005
express edition beta 2 and it won't compile the idl saying that there are 2
library blocks. The idl can be found on the desktop search developer page.

http://addins.msn.com/devguide.aspx#...sktopSearchApi

Thanks for any help.
Nov 17 '05 #1
3 3316
Ben,
I'm trying to use the IDL that's part of the Desktop search API in my C#
application. I'm having problems getting things to work. Can anyone point
me in the right direction for using IDL files with C#?
Try adding a reference to the ADO primary interop assembly, then try
these declarations

[ComImport, Guid("A227843C-1D92-48bc-AED6-DCA566F1790E"),
InterfaceType(C omInterfaceType .InterfaceIsIUn known)]
interface ISearchDesktop
{
Recordset ExecuteSQLQuery (
[MarshalAs(Unman agedType.LPWStr )] string lpcwstrSQL);

Recordset ExecuteQuery(
[MarshalAs(Unman agedType.LPWStr )] string lpcwstrQuery,
[MarshalAs(Unman agedType.LPWStr )] string
lpcwstrColumn,
[MarshalAs(Unman agedType.LPWStr )] string lpcwstrSort,
[MarshalAs(Unman agedType.LPWStr )] string
lpcwstrRestrict ion);
}
[ComImport, Guid("1AD68C99-00FB-416d-804B-C38DEE75D55E")]
class SearchDesktop {}

The other problem is I tried including it in a basic C++ app using the 2005
express edition beta 2 and it won't compile the idl saying that there are 2
library blocks.


You can just comment out one of them.

Mattias

--
Mattias SjŲgren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 17 '05 #2
Thanks for your help, but I must say I'm still pretty clueless about using
idl files. Would you know of any good resources to get myself started? I'm
not sure how to use the declarations you gave.

"Mattias Sjögren" wrote:
Ben,
I'm trying to use the IDL that's part of the Desktop search API in my C#
application. I'm having problems getting things to work. Can anyone point
me in the right direction for using IDL files with C#?


Try adding a reference to the ADO primary interop assembly, then try
these declarations

[ComImport, Guid("A227843C-1D92-48bc-AED6-DCA566F1790E"),
InterfaceType(C omInterfaceType .InterfaceIsIUn known)]
interface ISearchDesktop
{
Recordset ExecuteSQLQuery (
[MarshalAs(Unman agedType.LPWStr )] string lpcwstrSQL);

Recordset ExecuteQuery(
[MarshalAs(Unman agedType.LPWStr )] string lpcwstrQuery,
[MarshalAs(Unman agedType.LPWStr )] string
lpcwstrColumn,
[MarshalAs(Unman agedType.LPWStr )] string lpcwstrSort,
[MarshalAs(Unman agedType.LPWStr )] string
lpcwstrRestrict ion);
}
[ComImport, Guid("1AD68C99-00FB-416d-804B-C38DEE75D55E")]
class SearchDesktop {}

The other problem is I tried including it in a basic C++ app using the 2005
express edition beta 2 and it won't compile the idl saying that there are 2
library blocks.


You can just comment out one of them.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 17 '05 #3
IDL is a C++ only thing, you can't use IDL files in C#, you have to hand
code the interface definitions (that's what Mattias did) or you have to
import a typelib definition file. Such typelib can be built from a IDL file
using the MIDL compiler (see midl.exe /? for options), of course you need to
start from a correct idl file, the one you are using is "wrong" as it
contains multiple library definitions, you can try to remove one of them and
run midl.exe to generate the typelib. Once you have the tlb file you can try
to set a reference to it in VS.
Note that this Desktop search stuff is still in beta and is primarily meant
to be used from C++, if you don't have a good understanding of COM and C++,
you'll have a hard time to get things right.
Willy.

"Ben Phipps" <Be*******@disc ussions.microso ft.com> wrote in message
news:D2******** *************** ***********@mic rosoft.com...
Thanks for your help, but I must say I'm still pretty clueless about using
idl files. Would you know of any good resources to get myself started?
I'm
not sure how to use the declarations you gave.

"Mattias Sjögren" wrote:
Ben,
>I'm trying to use the IDL that's part of the Desktop search API in my C#
>application. I'm having problems getting things to work. Can anyone
>point
>me in the right direction for using IDL files with C#?


Try adding a reference to the ADO primary interop assembly, then try
these declarations

[ComImport, Guid("A227843C-1D92-48bc-AED6-DCA566F1790E"),
InterfaceType(C omInterfaceType .InterfaceIsIUn known)]
interface ISearchDesktop
{
Recordset ExecuteSQLQuery (
[MarshalAs(Unman agedType.LPWStr )] string lpcwstrSQL);

Recordset ExecuteQuery(
[MarshalAs(Unman agedType.LPWStr )] string lpcwstrQuery,
[MarshalAs(Unman agedType.LPWStr )] string
lpcwstrColumn,
[MarshalAs(Unman agedType.LPWStr )] string lpcwstrSort,
[MarshalAs(Unman agedType.LPWStr )] string
lpcwstrRestrict ion);
}
[ComImport, Guid("1AD68C99-00FB-416d-804B-C38DEE75D55E")]
class SearchDesktop {}

>The other problem is I tried including it in a basic C++ app using the
>2005
>express edition beta 2 and it won't compile the idl saying that there
>are 2
>library blocks.


You can just comment out one of them.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6374
by: Elp | last post by:
Hi, I have developped a Windows applcation (in C#) that allows, among other things, users to view and control the desktop of a remote Windows XP Pro machine. I have actually simply embedded the Remote Desktop ActiveX control in my C# app and this works fine. However i have now a new requirement for my app: multiple users have to be able to view and control the same remote desktop simultaneously using my application. Big problem:...
3
4187
by: Michael D. Murphy | last post by:
Hi, I am searching for a way to creat desktop shortcuts when running the setup files that were created within a VB solution using the setup wizard. Thanks, Michael
15
3033
by: Mephisto187 | last post by:
How can I find the currently visible desktop? By calling EnumWindowStations and EnumDesktops I get a list of all available desktops. But is there a way to figure out which one of them is currently visible? I've tried to find the visible desktop by comparing the desktop handle, returned by the OpenDesktop function, to the desktop handle received by calling OpenInputDesktop. The result is that the default desktop is always the one...
3
2482
by: boris | last post by:
i am not able to understand how can i create google desktop api using only C and C++.should i also need to learn other languages or knowledge of my favourite c++ will do.I am confused.If it's possible to create with only C++ then plz describe how!
5
1997
by: Terry Olsen | last post by:
To comply with corporate policy banning the storage of social security numbers on computers, I have been asked if I can search for files & emails that contain social security numbers. I thought that since every computer in our environment has Windows Desktop Search installed I could use that. When looking for the API, every link takes me to the main Windows Live page (link must be dead). Anyone have a good link to the API (2.x)? ...
1
1431
!NoItAll
by: !NoItAll | last post by:
Hi: I'm using the following script to find a shortcut with a specific string in it. In the code below the example is the word "font" My problem is that this code looks everywhere EXCEPT the individual users desktop - it does find all of the shortcuts in All Users, but not in specific users. I am executing the code AS the user whose desktop I need to search so there shouldn't be a security issue. I have to write a small routine to add...
4
1651
by: bz | last post by:
Hi, I need to create a win service that lookup a file ina folder, ands when received, read it then fir an event. Then I need a desktop app that, when runs, bind to the event from the win service, and when the event fires, read the eventarg data and do some processing with. Can anyone point me to the right direction to do this?
7
1977
nukefusion
by: nukefusion | last post by:
Hi all, I'm trying to think of the best way to achieve a certain goal and thought I would draw on the experience here. What I am currently doing is compiling a set of HTML files that form the help guide of an application I am working on. The help guide needs to be integrated into both a C# .NET desktop app AND a .NET based website using master pages. The requirements are that: (a) The same set of files are to be accessible through...
3
1790
by: eggman89 | last post by:
Hi I'm doing my Fourth Year B.E. project under the internship of MindTree! Now they have only told us what to do , but haven't guide much! Now, we have been told to develop an search application similar to Google Desktop one, only lighter version of it! This is how it should work: For all the Office 07 formats (docx,pptx....) which are XML based,rather than Binary based, the user should enter any search term(s) and our Prog should...
0
8695
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8989
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7901
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectóplanning, coding, testing, and deploymentówithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6614
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Duprť who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5938
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4708
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.