ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pyxpcom
pyxpcom
[pyxpcom] QueryInterface to base interface
by Sebastian Tusk other posts by this author
Apr 11 2007 7:48AM messages near this date
view in the new Beta List Site
[pyxpcom] XULRunner debugging and deployment | Re: [pyxpcom] QueryInterface to base interface
I have a problem with QueryInterface to base interfaces. It seems that 
pyxpcom does an unnecessary and maybe wrong re-wrapping of the object. 
The situation is that I have an implementation of nsIChannel in python. 
In the mozilla code a pointer to nsIChannel is cast to nsIRequest. Which 
is legal because nsIChannel derives from nsIRequest. With this new 
pointer to nsIRequest the mozilla code does an QueryInterface to 
nsIRequest and expects that it gets the same pointer but it gets a new 
one. See Assert_NoQueryNeeded in the mozilla code.

In the above case "nsIChannel-> QueryInterface( IID_nsIChannel ) == 
nsIChannel" as expected but "nsIRequest -> QueryInterface( IID_nsIRequest 
) != nsIRequest" which seems wrong to me and the check in 
Assert_NoQueryNeeded agrees with that. 
<http://lxr.mozilla.org/mozilla1.8/source/xpcom/glue/nsCOMPtr.h#589> 

Regards,
Sebastian



_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Sebastian Tusk
Mark Hammond
Sebastian Tusk

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved