Passing window.external to OCX (VB6) (or way of retrieving window.external like in C++ ServiceProvider) 
Author Message
 Passing window.external to OCX (VB6) (or way of retrieving window.external like in C++ ServiceProvider)

Hello everyone,
I have a UserControl that is initialized in another program (could be IE
too). What I want to do is pass the window.external object to it.
Currently, I have the html page that loads the OBJECT SpyKoControl and in
the header I have the following script:

<SCRIPT language="JavaScript" for=window event=onload>
<!--
SpyKoControl.SetExtensionHolder( window.external );
-->
</SCRIPT>

The Public SetExtensionHolder function in my UserControl sets a public
variable to this object and I can then reference it.  What I do when the
control is initialized is set a timer to check every 100 msec if the
SetExtensionHolder has initialized my variable, if not then re-enable the
timer, otherwise we have it and we can start using it.

So, following another post, it seems I cannot send the window.external
object as a parameter, but is there an API call that can do the same and
return the window.external object the UserControl is currently in?

Thanks in advance for any thoughts (and solution of course)
Spyro

PS. The following is really (no, really) difficult for me to follow, but if
it rings a bell to anyone, it might help track down exactly what I want to
do:

from: Palm Desktop SDK
/***************************************************************************
*******/
// Helper function to retrieve the Extension Host Object pointer
// using the client site.
// Typically called in SetClientSite (MFC programs would use
// the OnSetClientSite virtual function override to call this).
// From the Client site, retrieve the IServiceProvider interface.
// Ask the IServiceProvider for the IExtensionHolder interface.
// Returns S_OK on success, error code otherwise.

HRESULT
CTestExtCtrl::GetExtensionHostPtr ()
{
 HRESULT hr = E_UNEXPECTED;  // assume the worst
 CComPtr <IOleClientSite> spSite = GetClientSite ();
 ASSERT (spSite != NULL);
 if (spSite != NULL) {
  CComQIPtr <IServiceProvider> spSp = spSite;
  ASSERT (spSp != NULL);
  if (spSp != NULL) {
   IUnknown *pTemp = NULL;
   hr = spSp->QueryService (IID_IExtensionHolder, IID_IExtensionHolder,
(void **)&pTemp);
   if (pTemp) {
    m_spHost = pTemp;   // implicit AddRef
    pTemp->Release ();
   }
   ASSERT (m_spHost != NULL);
  }
 }
 return hr;

Quote:
}



Mon, 31 Jan 2005 00:56:07 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. 'shell'ing a external windows program withoud windows

2. window.external.OutlookApplication

3. Opening an External Application in a Single Window

4. need a way to close an external window

5. Generate Windows forms from external XML file

6. External XML files to generate windows controls

7. Accessing external tables with JET and windows 95 network neighbourhood

8. Interfacign external windows

9. windows and external dlls

10. External Windows Question

11. External Windows

12. Launching external Windows Programs

 

 
Powered by phpBB® Forum Software