Re: Passing back a java object

BAsh <[email protected]>
Newsgroups gmane.comp.mozilla.devel.java
Message-ID <04WdnQdkzYaNLFjYnZ2dnUVZ_vfinZ2d__18051.0829472498$1170585173$gmane$org@mozilla.org>
BAsh wrote:
> BAsh wrote:
>> How do you pass a jobject back from xpcom?
> 
> This can be done from @mozilla.org/oji/jvm-mgr;1
> 
> see: 
> http://lxr.mozilla.org/mozilla1.8/source/modules/oji/src/nsJVMManager.h#179
> 
> How do you get a JSContext then??

http://lxr.mozilla.org/mozilla1.8/source/content/base/src/nsDocument.cpp#4409

4403   nsIScriptGlobalObject* globalObject = nsIDocument.GetScriptGlobalObject();
4404   NS_ENSURE_TRUE(globalObject, PR_TRUE);
4405 
4406   nsIScriptContext *scriptContext = globalObject->GetContext();
4407   NS_ENSURE_TRUE(scriptContext, PR_TRUE);
4408 
4409   JSContext* cx = (JSContext *) scriptContext->GetNativeContext();
4410   NS_ENSURE_TRUE(cx, PR_TRUE);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.