lundi 29 juin 2015

How to properly use IOpenServiceManager::InstallService


Im trying to define a new IE search engine, but getting into trouble whenever i try to install the service.

I walked through the following example and only changed the name of the files

upload.xml:

 <OpenSearchDescription xmlns="http://ift.tt/LMPdQR">
   <ShortName>Web Search</ShortName>
   <Description>Use Example.com to search the Web.</Description>
   <Tags>example web</Tags>
   <Contact>admin@example.com</Contact>
   <Url type="application/rss+xml" 
        template="http://ift.tt/1Io4vf8"/>
 </OpenSearchDescription>

home.html

<html>
    <header>
        <link rel="search"
               type="application/opensearchdescription+xml" 
               href="http://ift.tt/1eeKknz"
               title="Content search" />
    </header>
</html>

Links are valid and work.

c++:

ATL::CComPtr<IOpenServiceManager> spManager;
if (FAILED(hr = spManager.CoCreateInstance(CLSID_OpenServiceManager)))
    return false;

//URL-OF-SERVICE: See http://ift.tt/1A8nEgo 
ATL::CComPtr<IOpenService> spService;
if (FAILED(hr = spManager->InstallService(L"http://ift.tt/1Io4vfe", &spService)))
    return 0;

if (FAILED(hr = spService->SetDefault(TRUE, nullptr)))
    return 0;

return 1;

Everytime i try to install the service i get (hr = 0xc00ce556 / E_INVALIDARG)


Aucun commentaire:

Enregistrer un commentaire