On Aug 31, 2:17 pm, "Nickolay Ponomarev" <[EMAIL PROTECTED]> wrote:
> So did you implement that method? You snipped the relevant code.
>
> Nickolay
>
> On 8/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > hey guys,
>
> > I ma making an xpcom component to listen to event generated by Mozilla
> > browser. It compiles fien ..but gives linker error .
>
> > MyComponent.obj : error LNK2001: unresolved external symbol "public:
> > virtual unsigned int __stdcall WebLock::GetWeakReference(class
> > nsIWeakReference * *)" (?
> > [EMAIL PROTECTED]@@UAGIPAPAVnsIWeakReference@@@Z)
> > 1>.\Debug\MyComponent.dll : fatal error LNK1120: 1 unresolved
> > externals
>
> > I am also pasting peace of code related to this error ..Please help me
> > get out of this error.
> > I am linking against xpcomglue_s.lib ,xpcom.lib ,plc4.lib nspr4.lib
> > and plds4,lib.
>
> > MyComponent.h
> > class WebLock : public nsIWebProgressListener,
> > public nsISupportsWeakReference,
> > public nsIObserver,
> > public iWeblock
> > {
> > public:
> > NS_DECL_ISUPPORTS
> > NS_DECL_NSIOBSERVER
> > NS_DELC_NSIWEBPROGRESSLISTENER
> > NS_DECL_NSISUPPORTSWEAKREFERENCE
> > ...............
> > ...............
> > };
>
> > MyComponent.cpp
>
> > NS_IMPL_ISUPPORTS4(WebLock, nsIWebProgressListener,
> > nsISupportsWeakReference,
> > nsIObserver,
> > iWeblock)
> > ............
> > .............
>
> > Thanks.
>
> > _______________________________________________
> > dev-tech-xpcom mailing list
> > [EMAIL PROTECTED]
> >https://lists.mozilla.org/listinfo/dev-tech-xpcom- Hide quoted text -
>
> - Show quoted text -

 i didnt implement it..But i searched for code that how may i do
that ..finally i m implementing the method as follow..and things
working properly..But i doubt whether i m correct or not..

NS_IMETHODIMP WebLock::GetWeakReference(nsIWeakReference **_retval)
{
        if ( !_retval )
                return NS_ERROR_NULL_POINTER;

    *_retval = new nsWeakReference((nsSupportsWeakReference *)this);

        nsresult status;
    if ( !*_retval )
                status = NS_ERROR_OUT_OF_MEMORY;
    else
        {
         NS_ADDREF(*_retval);
         status = NS_OK;
    }

    return status;
}

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to