javascript: won't work since I want to attach a C++ function to a javascript 
function so when a webpage calls that function I get notified in my 
application (and handle the data passed to it).

I assume it's something like this I just keep getting a failure trying to 
get the nsIDocument

nsCOMPtr<nsIDocument> dom = do_QueryInterface(mWebBrowser, &rv);
if(NS_FAILED(rv))
{
ATLASSERT(false);
return false;
}
nsCOMPtr<nsIScriptGlobalObject> scriptGlobal = dom->GetScriptGlobalObject();
nsCOMPtr<nsIScriptContext> context;
context = scriptGlobal->GetContext();

JSContext * cx = (JSContext *)(context->GetNativeContext());
JSObject * pJobj = scriptGlobal->GetGlobalJSObject();


"Boris Zbarsky" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Richard wrote:
>> but how do I get the interface to the nsIDocument
>>
>> will something like this work;
>> nsCOMPtr<nsIDocument> dom = do_QueryInterface(mWebBrowser, &rv);
>
> Ah, no.  If what you have is an nsIWebBrower, I strongly suggest using the 
> javascript: thing.  Anything else would rely on implementation details...
>
> -Boris 


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

Reply via email to