Registering your protocol handler. Actual code.

by Matt 18. October 2006 15:32

Enough procrastination. I've set the lofty goal. I've worried about documentation. I've fretted about SDKs. I've even lectured on how I want my project set up. I haven't written a single line of code. For shame.

To be fair, this is going to be a little dull, so let's rush through the boring bits. Following my own advice, I've created an ATL project called msfeedph and deleted all the unnecessary bits. I've also added the include directories of the WDS SDK, the msfeeds API mini-SDK + the SharePoint Portal 2001 SDK to the project. I've then included wdsSetup.h in the stdafx.h.

Now we're ready to register our protocol handler. The docs say that we need to call ISearchManager::AddProtocol. Looking at wdsSetup.idl, we can see that the SearchManager object implements ISearchManager, so let's create one of those, and call AddProtocol. We need to pass in a protocol name, and the ProgId of an object that will handle that protocol. We'll use "msfeed" as the protocol name, and "Sticklebackplastic.MsFeedProtocolHandler.1" as the ProgId. We'll also do a reciprocal RemoveProtocol. Here's the code:

STDAPI DllRegisterServer(void)
{
    HRESULT hr = _AtlModule.DllRegisterServer(FALSE);
    CComPtr<ISearchManager> spSearchManager;
    hr = spSearchManager.CoCreateInstance(CLSID_SearchManager);
    if(SUCCEEDED(hr))
    {
        hr = spSearchManager->AddProtocol(L"msfeed", L"Sticklebackplastic.MsFeedProtocolHandler.1");
    }

    return hr;
}

STDAPI DllUnregisterServer(void)
{
    HRESULT hr = _AtlModule.DllUnregisterServer(FALSE);
    CComPtr<ISearchManager> spSearchManager;
    hr = spSearchManager.CoCreateInstance(CLSID_SearchManager);
    if(SUCCEEDED(hr))
    {
        hr = spSearchManager->RemoveProtocol(L"msfeed");
    }

    return hr;
}

Excellent. Just one small problem - it doesn't compile. CLSID_SearchManager is an undefined symbol. We need to add a new file, that I've called DefineGuids.cpp:

#include "stdafx.h"
#define INITGUID
#include <wdsSetup_i.c>

This just includes the C part of the file generated from wdsSetup.idl, which fortunately for us, declares the GUIDs from the idl file.

Now we compile and register and all is well. We don't yet have a "Sticklebackplastic.MsFeedProtocol.Handler.1" class so nothing appears in WDS yet, but it's a start. We can check the registry (HKCU\Software\Microsoft\RSSearch\ProtocolHandlers) and see that it's there.

The next step is to set the default urls that WDS will crawl.

You can download the current code here.

Tags:

Windows Desktop Search

Comments (99) -

LAURENCE  Debora
LAURENCE Debora
7/3/2011 1:19:41 AM #

Listes d'annuaires & annuaire d'annuaires sur annuaires-gratuit.com, vos commentaires s.vp ??

Reply

LAURENCE  Debora
LAURENCE Debora
7/3/2011 3:07:01 AM #

Portail de recherche gratuit, moteur de recherche, vos commentaires et critique s.vp ??

Reply

LAURENCE  Debora
LAURENCE Debora
7/18/2011 9:02:09 AM #

référencer un site, sur annuaires-gratuit.com.Top 30 annuaires, créer un annuaire.

Reply

astuce casino
astuce casino France
7/19/2011 10:54:20 AM #

Reliable info. Propitious me I reach on your website about casualty, I bookmarked it.

Reply

LAURENCE  Debora
LAURENCE Debora
7/20/2011 8:40:43 AM #

Recherche de blogs sur annuaires-gratuit.com, création annuaire en ligne gratuit .

Reply

best suv reviews
best suv reviews
7/20/2011 10:24:20 PM #

Per il tuo bambino scegli Moncler. Una scelta di capi, estivi ed invernali, eccezionali. Tuo figlio sarà sempre alla moda e potrà muoversi in totale comodità.

Reply

suv comparison
suv comparison
7/20/2011 10:40:03 PM #

Per il tuo bambino scegli Moncler. Una scelta di capi, estivi ed invernali, eccezionali. Tuo figlio sarà sempre alla moda e potrà muoversi in totale comodità.

Reply

luxury cars brands
luxury cars brands
7/21/2011 4:41:49 PM #

Una pagina sarà dedicata agli accessori, una alle giacche e ai giubbotti. Troverai le indicazioni per lo spaccio o negozio Moncler più vicino a casa tua e tutte le offerte più vantaggiose di questo prestigioso marchio.

Reply

best hybrid cars
best hybrid cars
7/22/2011 4:37:31 AM #

I wonder if he cheated on her? I remember he cheated on his previous wife with JLO so it wouldn’t be surprising.

Reply

LAURENCE  Debora
LAURENCE Debora
7/23/2011 12:55:52 PM #

L' autre moteur de recherche pertinent Sukoga.com, recherche en ligne images, wiki...

Reply

iphone os 4.0
iphone os 4.0
7/23/2011 8:56:27 PM #

Fantastic task I like your type! Would really like to right here your feedback on my website! I am also seeking for someone to help you me make websites!

Reply

iphone developer program
iphone developer program
7/24/2011 4:26:42 AM #

Hi,what an excellent article this is,I found it on bing and I like it very much,I agree with what you have said, lots of things will be learned form your site,but I still have some questions with the last part,can you explain it for me ?I will appreciate your answer,and I will be back again!

Reply

iphone4 case
iphone4 case
7/27/2011 8:43:50 PM #

I wonder if he cheated on her? I remember he cheated on his previous wife with JLO so it wouldn’t be surprising.

Reply

direct consolidation loans
direct consolidation loans
8/2/2011 8:14:38 PM #

Is it ok if I quote your article in my monthly newsletter? I would think this article suits my topic perfectly. Well ya, thanks for posting this article.

Reply

photographe mariage paris
photographe mariage paris United States
6/8/2015 1:56:10 AM #

Thanks for your posting. Another factor is that just being a photographer entails not only difficulties in capturing award-winning photographs but in addition hardships in establishing the best camera suited to your needs and most especially issues in maintaining the standard of your camera. It is very true and noticeable for those photography fans that are directly into capturing the nature's exciting scenes -- the mountains, the particular forests, the actual wild and the seas. Going to these daring places surely requires a photographic camera that can surpass the wild's tough natural environment.

Reply

Tommy Burows
Tommy Burows United States
1/15/2016 6:07:42 AM #

I love the dolphin saving you one.

Reply

Mitch Groene
Mitch Groene United States
1/15/2016 6:44:27 AM #

AWESOME!Can't wait for that, will be something to want to accomplish day by day, to do something AWESOME!

Reply

Reuben Ellenbecker
Reuben Ellenbecker United States
1/15/2016 8:29:14 AM #

Hey, congratulations Neil. This site really is something special and it's been a pleasure to share it with my readership too. Looking forward to future awesome things, and I'll send any suggestions that are sufficiently awesome.

Reply

Johnathon Paulson
Johnathon Paulson United States
1/15/2016 8:31:11 AM #

Congrats! So glad to see this site getting the recognition it deserves, the world can always use a little more awesome.

Reply

Maisie Anglen
Maisie Anglen United States
7/24/2016 5:18:34 PM #

This is a wonderful web page, could possibly by yourself be fascinated inside shifting during an job interview about accurately how oneself crafted it? If as a result emails me!

Reply

Kristle Tongue
Kristle Tongue United States
8/25/2016 4:13:02 AM #

In today's technological advances, we sure hope to read another informative post like this about the smart house architectural planning

Reply

Rachael Milles
Rachael Milles United States
8/25/2016 4:26:00 AM #

Howdy! I know this is somewhat  but I was thinking which post platform are you using for this website? I’m getting tired of WordPress because I’ve had issues with autopcposters and I’m looking at other ways for another platform. It would be great if you could refer me in the direction of a good platform.

Reply

Issac Maez
Issac Maez United States
10/18/2016 2:33:14 AM #

Bonjour � vous, j'appr�cie votre site et je tenais � vous le dire ! bonne continuation !

Reply

Issac Maez
Issac Maez United States
10/18/2016 2:40:29 AM #

Bonjour � vous, j'appr�cie votre site et je tenais � vous le dire ! bonne continuation !

Reply

Luigi Fulk
Luigi Fulk United States
10/18/2016 2:42:15 AM #

Je suis souvent votre site et je le trouve parfait ! ;) continuez comme �a !

Reply

Free Online Casino Credits
Free Online Casino Credits United States
5/16/2018 10:54:45 AM #

For services that can be used through the service system through the system of free online mobile betting , there are many types. Whether it is in the matter of contact. You can use the service 24 hours a day with fast withdrawal. Can be done immediately. New members and online sports betting via mobile phone was.Get instant bonus bonuses. The more you invite your friends to bet on your mobile, the more bonuses you get. There are also many commissions on bets. Apart from playing through the mobile betting system. Can also play online casino via mobile as well. There are also commissions. There are no refunds for the members of the bet. Every month The good thing about mobile gambling is that the members are guaranteed a safe bet. Be it in the betting information and financial systems. personal Information You can be assured that you will definitely be safe. There are also many new entrances to use. For people using mobile. There is an update link for mobile. Link to the mobile phone iPhone. Link to the Android mobile system. AIS mobile access gateway Link to the mobile phone good. True Move Mobile Access Gateways It is available through all mobile phone systems, as well as multi-channel service. The members have fun to win free lottery every time.

Reply

For services that can be used through the service system through the system of free online mobile betting , there are many types. Whether it is in the matter of contact. You can use the service 24 hours a day with fast withdrawal. Can be done immediately. New members and online sports betting via mobile phone was.Get instant bonus bonuses. The more you invite your friends to bet on your mobile, the more bonuses you get. There are also many commissions on bets. Apart from playing through the mobile betting system. Can also play online casino via mobile as well. There are also commissions. There are no refunds for the members of the bet. Every month The good thing about mobile gambling is that the members are guaranteed a safe bet. Be it in the betting information and financial systems. personal Information You can be assured that you will definitely be safe. There are also many new entrances to use. For people using mobile. There is an update link for mobile. Link to the mobile phone iPhone. Link to the Android mobile system. AIS mobile access gateway Link to the mobile phone good. True Move Mobile Access Gateways It is available through all mobile phone systems, as well as multi-channel service. The members have fun to win free lottery every time.

Reply

baexkitty
baexkitty United States
5/22/2018 10:16:59 PM #

She may take her panties off at any time!

Reply

Funny Website
Funny Website United States
5/23/2018 4:00:59 PM #

Have a good laugh at this site.

Reply

Reyna Flener
Reyna Flener United States
7/23/2018 8:20:02 AM #

With thanks! Valuable information!

Reply

Hobert Kennin
Hobert Kennin United States
8/2/2018 10:51:48 PM #

With thanks! Valuable information!

Reply

Miguel Groene
Miguel Groene United States
8/3/2018 3:37:46 AM #

With thanks! Valuable information!

Reply

Bernie Yamkosumpa
Bernie Yamkosumpa United States
8/3/2018 4:29:44 AM #

Black on black in the Charg I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Magaly Pan
Magaly Pan United States
8/3/2018 5:20:00 AM #

With thanks! Valuable information!

Reply

Gale Vittetoe
Gale Vittetoe United States
8/3/2018 5:20:01 AM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Cherelle Centrich
Cherelle Centrich United States
8/3/2018 10:21:52 AM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Roberto Arron
Roberto Arron United States
8/3/2018 11:55:47 AM #

With thanks! Valuable information!

Reply

Linsey Hynek
Linsey Hynek United States
8/3/2018 3:19:01 PM #

Don’t wear seat belts lest you drown in you own urine?

Reply

Phyliss Everitt
Phyliss Everitt United States
8/3/2018 3:21:25 PM #

Black on black in the Charg I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Alonso Feser
Alonso Feser United States
8/3/2018 3:21:26 PM #

Don’t wear seat belts lest you drown in your own urine?

Reply

Kareem Beesley
Kareem Beesley United States
8/3/2018 8:51:27 PM #

Don’t wear seat belts lest you drown in you own urine?

Reply

Heather Severin
Heather Severin United States
8/3/2018 9:44:33 PM #

Don’t wear seat belts lest you drown in your own urine?

Reply

Lucretia Colby
Lucretia Colby United States
8/4/2018 1:57:45 AM #

Black on black in the Charg I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Jacalyn Gallob
Jacalyn Gallob United States
8/4/2018 4:13:31 AM #

Don’t wear seat belts lest you drown in you own urine?

Reply

Delfina Conrady
Delfina Conrady United States
8/4/2018 6:03:10 AM #

Don’t wear seat belts lest you drown in you own urine?

Reply

Carolina Morgenstein
Carolina Morgenstein United States
8/4/2018 7:09:33 PM #

With thanks! Valuable information!

Reply

Stanford Edgett
Stanford Edgett United States
8/4/2018 7:57:02 PM #

Don’t wear seat belts lest you drown in you own urine?

Reply

Tillie Sales
Tillie Sales United States
8/4/2018 9:47:35 PM #

Black on black in the Charg I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Archie Gour
Archie Gour United States
8/4/2018 10:27:53 PM #

Don’t wear seat belts lest you drown in you own urine?

Reply

Eldon Schontz
Eldon Schontz United States
8/4/2018 11:25:04 PM #

Black on black in the Charg I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Herbert Ludden
Herbert Ludden United States
8/5/2018 1:54:40 AM #

Don’t wear seat belts lest you drown in you own urine?

Reply

Andy Ewards
Andy Ewards United States
8/5/2018 2:10:33 AM #

With thanks! Valuable information!

Reply

Lola Leinen
Lola Leinen United States
8/5/2018 3:12:59 AM #

Don’t wear seat belts lest you drown in you own urine?

Reply

Benito Reedy
Benito Reedy United States
8/5/2018 4:54:03 AM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Verlie Dilligard
Verlie Dilligard United States
8/5/2018 1:35:06 PM #

Don’t wear seat belts lest you drown in your own urine?

Reply

Alonso Feser
Alonso Feser United States
8/5/2018 7:14:55 PM #

With thanks! Valuable information!

Reply

Ivan Jauregui
Ivan Jauregui United States
8/6/2018 7:00:47 AM #

With thanks! Valuable information!

Reply

Starla Vanderstappen
Starla Vanderstappen United States
8/6/2018 10:34:52 AM #

Black on black in the Charg I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Julianna Sazama
Julianna Sazama United States
8/6/2018 1:18:15 PM #

Don’t wear seat belts lest you drown in your own urine?

Reply

Soo Rike
Soo Rike United States
8/6/2018 2:41:28 PM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Jamal Sulieman
Jamal Sulieman United States
8/6/2018 3:31:35 PM #

Black on black in the Charg I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Berneice Helf
Berneice Helf United States
8/6/2018 4:26:57 PM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Rosalba Viale
Rosalba Viale United States
8/6/2018 5:33:47 PM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Jeanett Luvianos
Jeanett Luvianos United States
8/7/2018 3:29:40 AM #

Black on black in the Charg I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Mauricio Fellman
Mauricio Fellman United States
8/11/2018 2:06:57 AM #

With thanks! Valuable information! http://bnuphoto.com

Reply

Alethea Caiazzo
Alethea Caiazzo United States
8/11/2018 4:04:45 AM #

I got what you mean,saved to fav, very decent site. https://bzp65.com/

Reply

Kenia Coller
Kenia Coller United States
8/11/2018 4:24:16 AM #

I conceive this web site has got some real good information for everyone https://php665.com/

Reply

Josef Conejo
Josef Conejo United States
8/11/2018 4:39:25 AM #

Awesome! Its in fact amazing paragraph, I have got much clear idea regarding from this piece of https://yong79.com/

Reply

Clark Mago
Clark Mago United States
8/11/2018 5:20:31 AM #

sound like you know what you?re talking about! Thanks https://newone2017.com/

Reply

Damien Schettler
Damien Schettler United States
8/11/2018 9:34:40 AM #

With thanks! Valuable information! https://miso7700.com/

Reply

Samuel Rudell
Samuel Rudell United States
8/13/2018 7:13:43 PM #

I like the helpful info you provide in your articles. I will bookmark your weblog and check again here regularly. https://bzp65.com/

Reply

Dallas Pelletiu
Dallas Pelletiu United States
8/14/2018 9:49:17 AM #

of writing i am as well delighted to share my know-how here with colleagues. https://bzp65.com/

Reply

Joey Morman
Joey Morman United States
8/14/2018 8:20:58 PM #

sound like you know what you?re talking about! Thanks https://bzp65.com/

Reply

Allen Mathewes
Allen Mathewes United States
8/17/2018 8:08:17 AM #

This is a impressive story. Thanks! https://php665.com/

Reply

Leeanna Elbie
Leeanna Elbie United States
8/17/2018 4:13:36 PM #

This is a impressive story. Thanks! https://bzp65.com/

Reply

Robena Folley
Robena Folley United States
8/20/2018 1:06:05 AM #

With thanks! Valuable information! https://php665.com/

Reply

Carolyne Humenik
Carolyne Humenik United States
8/20/2018 4:59:12 AM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini https://bzp65.com/

Reply

Milagro Fernadez
Milagro Fernadez United States
8/20/2018 9:45:57 AM #

With thanks! Valuable information! https://php665.com/

Reply

Kathe Bierbrauer
Kathe Bierbrauer United States
8/29/2018 9:32:49 AM #

I conceive this web site has got some real good information for everyone https://newone2017.com/

Reply

Pablo Sumey
Pablo Sumey United States
9/1/2018 11:42:48 AM #

I’m quite certain I’ll learn lots of new stuff right https://newone2017.com/

Reply

Cecila Paukert
Cecila Paukert United States
9/3/2018 5:56:39 PM #

With thanks! Valuable information!

Reply

Noe Sirnio
Noe Sirnio United States
9/4/2018 4:39:34 PM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini https://newone2017.com/

Reply

Jere Buddington
Jere Buddington United States
9/5/2018 5:36:10 AM #

Don’t wear seat belts lest you drown in your own urine?

Reply

Gregorio Amormino
Gregorio Amormino United States
9/6/2018 12:44:29 PM #

With thanks! Valuable information!

Reply

Jere Buddington
Jere Buddington United States
9/6/2018 12:54:02 PM #

here! Good luck for the next! https://newone2017.com/

Reply

Jarvis Corprew
Jarvis Corprew United States
9/8/2018 4:56:31 PM #

I’m quite certain I’ll learn lots of new stuff right https://newone2017.com/

Reply

Milford Baenziger
Milford Baenziger United States
9/10/2018 11:52:08 AM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Frederick Wentzell
Frederick Wentzell United States
9/10/2018 5:10:45 PM #

good stuff. I will make sure to bookmark your blog. https://newone2017.com/

Reply

Maisha Dunkentell
Maisha Dunkentell United States
9/11/2018 1:39:38 PM #

Don’t wear seat belts lest you drown in your own urine?

Reply

Rafael Bawany
Rafael Bawany United States
9/12/2018 11:02:43 AM #

This is a impressive story. Thanks! https://newone2017.com/

Reply

realistic dildo
realistic dildo United States
9/12/2018 5:28:23 PM #

Aw, that was an extremely good post. Operating in option I wish to make a note of that way aside from that ( space spending time and furthermore particular motivation to manufacture a suitable article… about the other hand should you wish to I truly say… You put things off appear won’t be able to  discover a method to go done.

Reply

Arlie Crabbs
Arlie Crabbs United States
9/13/2018 9:23:18 PM #

of writing i am as well delighted to share my know-how here with colleagues. https://newone2017.com/

Reply

Alane Cavalieri
Alane Cavalieri United States
9/14/2018 10:36:29 AM #

Black on black in the Charger I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Ward Ferrick
Ward Ferrick United States
9/15/2018 1:49:33 PM #

Don’t wear seat belts lest you drown in your own urine?

Reply

Morgan Monet
Morgan Monet United States
9/15/2018 7:43:14 PM #

I got what you mean,saved to fav, very decent site. https://newone2017.com/

Reply

Roland Heaton
Roland Heaton United States
9/17/2018 7:22:45 AM #

Black on black in the Charg I'm creepin' Rub me the right way, you might get a genie B.o.B, black Houdini

Reply

Lanny Myerscough
Lanny Myerscough United States
9/17/2018 6:21:17 PM #

I have been checking out many of your stories and i can state pretty https://newone2017.com/

Reply

Mel Plack
Mel Plack United States
9/20/2018 3:59:52 AM #

here! Good luck for the next! https://newone2017.com/

Reply

cash for cars
cash for cars United States
9/20/2018 5:10:00 AM #

I'm extremely impressed with your writing skills and also with the layout on your weblog. Is this a paid theme or did you modify it yourself? Either way keep up the nice quality writing, it’s rare sex see a nice poker like this one these days..

Reply

Add comment

biuquote
  • Comment
  • Preview
Loading

Rel=Me

Month List

RecentComments

Comment RSS