I am trying to access the proxy settings for Mozilla using the prefs service from a Windows C++ application. To minimize DLL depenedencies, I would like to use xpcomglue.lib. I don't want to redistribute Mozilla, I just want to use the prefs if it is installed. Our application uses IE or Mozilla proxy settings depending upon which browser is installed and preferred.

I'm including these headers:
#include <nsCOMPtr.h>
#include <nsIPref.h>
#include <nsIServiceManagerUtils.h>

and getting the prefs service using:
{
    nsCOMPtr<nsIPref> pMozPrefs(do_GetService(NS_PREF_CONTRACTID, &rv));
}

and linking against xpcomglue.lib.

My Mozilla tree is the 1.0 tree, and I'm using Visual C++.NET. (VC7)

The problem is I'm getting a few link errors:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall nsGetServiceByContractID::~nsGetServiceByContractID(void)" (__imp_??1nsGetServiceByContractID@@[EMAIL PROTECTED]) referenced in function "public: __thiscall CERHttpProxyInfoMoz::CERHttpProxyInfoMoz(void)" (??0CERHttpProxyInfoMoz@@[EMAIL PROTECTED])
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall nsGetServiceByContractID::nsGetServiceByContractID(char const *,class nsISupports *,unsigned int *)" (__imp_??0nsGetServiceByContractID@@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) referenced in function "class nsGetServiceByContractID const __cdecl do_GetService(char const *,unsigned int *)" (?do_GetService@@YA?BVnsGetServiceByContractID@@[EMAIL PROTECTED])
error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl nsDebug::PreCondition(char const *,char const *,char const *,int)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED]) referenced in function "public: class nsDerivedSafe<class nsIPref> * __thiscall nsCOMPtr<class nsIPref>::operator->(void)const " ([EMAIL PROTECTED]@@@@[EMAIL PROTECTED]@@@@XZ)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl nsDebug::Assertion(char const *,char const *,char const *,int)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED]) referenced in function "public: void __thiscall nsCOMPtr<class nsIPref>::Assert_NoQueryNeeded(void)" ([EMAIL PROTECTED]@VnsIPref@@@@QAEXXZ)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall nsQueryInterface::nsQueryInterface(class nsISupports *,unsigned int *)" (__imp_??0nsQueryInterface@@[EMAIL PROTECTED]@@[EMAIL PROTECTED]) referenced in function "class nsQueryInterface const __cdecl do_QueryInterface(class nsISupports *,unsigned int *)" (?do_QueryInterface@@YA?BVnsQueryInterface@@PAVnsISupports@@[EMAIL PROTECTED])


Any ideas on what the problem(s) are? Do I need a more modern Mozilla tree?

Thanks in advance,

Andrew Goodale
Developer, Choreographer
Documentum - Collaboration Group
------------------------------------------------------------------------------
www.Documentum.com




Reply via email to