Search completed in 0.84 seconds.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
in order to communicate with xpcom after this point, you should use an
nsiproxyobjectmanager.
...
nsiproxyobjectmanager proxy = (
nsiproxyobjectmanager)componentmanager.createinstancebycontractid("@mozilla.org/xpcomproxy;1",null,
nsiproxyobjectmanager.ns_iproxyobjectmanager_iid); // and use the proxy object manager to create a proxy for the nsiwindowwatcher instance we created above.
... nsiwindowwatcher windowproxy = (nsiwindowwatcher)proxy.getproxyforobject(eventqueue,windowwatcher.ns_iwindowwatcher_iid,windowwatcher,
nsiproxyobjectmanager.invoke_sync); // now we use the proxy to call the method as usual.
... windowproxy.openwindow(null, chromeuri, name, "centerscreen", null); for more information, please see xulplanet's documentation of
nsiproxyobjectmanager this was taken from injecting events onto xpcom’s ui thread ...
nsISupports proxies
the following interface is now obsolete:
nsiproxyobjectmanager.
...see xpcom/proxy/public/
nsiproxyobjectmanager.idl for the updated interface and its documentation.
... from a users point of view, you need only to look at the
nsiproxyobjectmanager.
... example usage nsresult rv = ns_ok; nscomptr<
nsiproxyobjectmanager> piproxyobjectmanager(do_getservice("@mozilla.org/xpcomproxy;1", &rv)); if(ns_failed(rv)) return rv; nscomptr<ifoo> ptestobj(do_createinstance(foo_contractid, &rv)); if(ns_failed(rv)) return rv; nscomptr<ifoo> pproxy; rv = piproxyobjectmanager->getproxyforobject(ns_proxy_to_main_thread, ifoo::getiid(), ptestobj, ns_proxy_sync | ns_proxy_always, getter_addrefs(pproxy)); if(ns_failed(rv)) ret...