How to register protocol handler WDS? Plus many more

Hello,

I am facing problems in registering my protocol handler forWindowsDesktop

Search.

I have written a protocol handler implementing ISearchProtocol, ISearchProto

colOptions. Only Init of ISearchProtocol gets called, but GetDefaultCrawlSc

ope of ISearchProtocolOptions is not called by WDS. Therefore i am not able

to call AddProtocol().

Hence i am not able to register my protocol handler.

Do i need to do someregistry settings ? If so what all?

I do not intend to implement any filter, i would like to use existing filterswhich can filter .txtfiles. Is this possible?
I need this information to proceed, anddocumentation is not good for WDS. S

o any help is highly appriciated!

Ganesh

[1637 byte] By [gpr2kor] at [2007-12-24]
# 1

Hello Ganesh,

The instructions for adding a new protocol handler can be found here:

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

Since you want to use a preexisiting filter that is already registered for your file type (.txt), you should be able to use ISearchProtocol->GetFileName/GetClassID to determine which IFilter needs to be used and then load that IFilter. You can find additional info on this here:

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

Paul Nystrom - MSFT

PaulNystrom-MSFT at 2007-8-31 > top of Msdn Tech,Windows Search Technologies,Windows Desktop Search Development...
# 2

Thanks Paul,

I have followed instructions given http://addins.msn.com/devguide.aspx#RegisteringaProtocolHandler. Please have a look at the code below to register in DLLRegisterServer method.

I assume that the PH is registered with this. I have implemented ISearchProtocolOptions , but in this, AddDefaultUrl is not invoked by WDS.

// DllRegisterServer - Adds entries to the system registry

STDAPI DllRegisterServer(void)

{

HRESULT hr = _AtlModule.DllRegisterServer();

CComPtr<IUnknown> pUnkn;

hr=pUnkn.CoCreateInstance(__uuidof(SearchManager),NULL,CLSCTX_INPROC_SERVER);

if SUCCEEDED(hr)

{

ISearchManager *spSearchManager;

// Query for ISearchManager interface

hr = pUnkn->QueryInterface(__uuidof(ISearchManager), (void**)&spSearchManager);

if SUCCEEDED(hr) {

hr = spSearchManager->AddProtocol(L"MY", L"PH.ProtocolHandler.1");

if(SUCCEEDED(hr)){

printf("added the protocol\n\n");

}

}

}

return hr;

}

gpr2kor at 2007-8-31 > top of Msdn Tech,Windows Search Technologies,Windows Desktop Search Development...
# 3
Hi, I am a fresh man of developing protocol for WDS.
I can not find protocol handler code sample located in <sdk_root>\Samples\SPS\Phandler\src.
Could you send me that. Email: niguojun@hotmai.com. Thanks!
JohnnyNi at 2007-8-31 > top of Msdn Tech,Windows Search Technologies,Windows Desktop Search Development...