Here's basically what we are doing (keep in mind it's a lot of code so I've
cut out a lot of details). I really appreciate any insite, I've been
stumbling around LXR trying to find some hint as to what might be wrong, but
so far nothing.
Thanks,
--Richard
nsIDocument* m_pmyDoc;
nsCOMPtr<nsIDocShell> mDocShell;
nsPluginWindow * m_window;
nsCOMPtr<nsIScriptGlobalObject> mScriptGlobal;
nsCOMPtr<nsIPluginInstance> m_instance;
nsCOMPtr<nsIAppShell> mAppShell;
nsIPluginInstanceOwner* m_nsPluginOwner;
mDocShell = do_CreateInstance( "@mozilla.org/webshell;1" );
nsCOMPtr<nsIDOMDocument> domdoc( do_GetInterface( mDocShell ) );
mDocShell->SetCurrentURI( pURL );
nsCOMPtr<nsIContentPolicy> policy =
do_GetService("@mozilla.org/layout/content-policy;1");
UNUSED(policy);
nsresult rv = NS_NewPluginDocument( &m_pmyDoc );
m_pmyDoc->SetBaseURI( pURL );
rv = NS_NewScriptGlobalObject( PR_FALSE, getter_AddRefs( mScriptGlobal ) );
m_pmyDoc->SetScriptGlobalObject( mScriptGlobal );
mScriptGlobal->SetDocShell( NS_STATIC_CAST( nsIDocShell*, mDocShell ) );
nsCOMPtr<nsIScriptContext> context;
rv = NS_CreateScriptContext( mScriptGlobal, getter_AddRefs( context ) );
mScriptGlobal->SetGlobalObjectOwner( NS_STATIC_CAST(
nsIScriptGlobalObjectOwner*, this ) );
nsCOMPtr<nsIDOMDocument> pDoc( do_QueryInterface( m_pmyDoc ) );
mScriptGlobal->SetNewDocument( pDoc, NULL, PR_TRUE, PR_TRUE );
context->WillInitializeContext();
context->InitClasses(pJObj);
context->DidInitializeContext();
//Set up plugin paramerters
//.....
//.....
m_nsPluginOwner = reinterpret_cast<nsIPluginInstanceOwner*>( m_pOwnerdata);
nsCOMPtr<nsIPluginHost> ph( do_GetService( kCPluginManagerCID ) );
nsIStreamListener *aStreamListener = NULL;
nsresult rv = ph->InstantiateEmbeddedPlugin( FLASH_MIME_TYPE,
(nsIURI*)m_pURL, m_nsPluginOwner );
nsCOMPtr<nsIPluginDocument> pDoc ( do_QueryInterface(
m_pOwnerdata->m_pmyDoc ) );
pDoc->SetStreamListener(aStreamListener);
nsCOMPtr<nsIPluginInstance> pPlugin;
m_nsPluginOwner->GetInstance(*getter_AddRefs(pPlugin));
pPlugin->SetWindow( m_window );
"Boris Zbarsky" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Richard wrote:
>> The part that's confusing me is the dom seems to be created (javascript
>> document holds a valid object) it just seems that quering for the element
>> fails.
>
> Like I said, unless you tell me more about the setup that's about all I
> can tell you...
>
> -Boris
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding