Hello everyone
I derived my event class from nsIPrivateDOMEvent too.
In my implementation of nsIPrivateDOMEvent all I do is forward the behaviour
to the instance of the event like this:
NS_IMETHODIMP DOMCustomEvent::GetInternalNSEvent(nsEvent** aNSEvent)
{
nsresult res;
res = mPrivateEvent->GetInternalNSEvent(aNSEvent);
return res;
}
where mPrivateEvent is this:
mPrivateEvent = do_QueryInterface(mEvent,res);
What happens now is that in C++ I get a null pointer error when
dispatchEvent is called.
My intuition tells me something is not quite right in that
GetInternalNSEvent(..) call but I don't know what that function does and
what it should return. It gets called and the pointer returned is valid
though.
Many thanks.
-----Original Message-----
From: dev-embedding-bounces+walter.fettich=lasting...@lists.mozilla.org
[mailto:dev-embedding-bounces+walter.fettich=lasting...@lists.mozilla.org]
On Behalf Of Walter Fettich
Sent: Thursday, January 22, 2009 10:15 AM
To: [email protected]
Subject: RE: Why can't I send my custom event?
Hello Boris
I can find a header nsIPrivateDOMEvenmt.h but not a nsIprivateDOMEvent.idl.
-----Original Message-----
From: dev-embedding-bounces+walter.fettich=lasting...@lists.mozilla.org
[mailto:dev-embedding-bounces+walter.fettich=lasting...@lists.mozilla.org]
On Behalf Of Boris Zbarsky
Sent: Thursday, January 22, 2009 5:32 AM
To: [email protected]
Subject: Re: Why can't I send my custom event?
Walter Fettich wrote:
> initEvent works fine. It is dispatchEvent that is causing the trouble.
> I tried to send the event from Javascript and from C++ and I get the
> same result 0x80070057 meaning NS_ERROR_ILLEGAL_VALUE as an exception
> in JS and return code from dispatchEvent in C++.
Ah, ok. Does your class just implement nsIDOMEvent? Or does it also
implement nsIPrivateDOMEvent? The latter is required for correct event
dispatch.
-Boris
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding