Once again: What is the first possibility to fire an event in ATL ActiveX? 
Author Message
 Once again: What is the first possibility to fire an event in ATL ActiveX?

This question was already stated several times in the past, but after
browsing thousands of pages I din't find any solution yet.

Just to be more specific:
My ActiveX object is loaded into html page with OBJECT tag. After that
I use it's properties in standard VBScript event handlers to
dynamically change the content of the page.

But if I try to read properties in standard browser event handlers
like document_onload or document_onreadystatechange for the first time
loading of component I recieve error messages - Object does not
support this property/method.

So I want to add my own event which will notify VBscript that object
is loaded and already initialized - e.g. Fire_Ready().

Now the only problem is to find out where to raise this event...
And this turned out to be pretty hard task.

So if you know the answer or know where to look for it - may I ask you
to help?



Thu, 28 Apr 2005 10:00:42 GMT  
 Once again: What is the first possibility to fire an event in ATL ActiveX?
I always do it this way:

<object id="myobj" classid="..."></object>
<script language="JavaScript">
if (myobj.object)
{
    // object ready

Quote:
}

else
{
    // instantiation failed
Quote:
}

</script>

Works just fine. By the time the script executes, the object is already
fully instantiated and ready to be called. Well, unless your object
performs some asynchronous download or something, in which case it is a
good idea to have readyState property and fire onReadyStateChange event.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> This question was already stated several times in the past, but after
> browsing thousands of pages I din't find any solution yet.

> Just to be more specific:
> My ActiveX object is loaded into html page with OBJECT tag. After that
> I use it's properties in standard VBscript event handlers to
> dynamically change the content of the page.

> But if I try to read properties in standard browser event handlers
> like document_onload or document_onreadystatechange for the first time
> loading of component I recieve error messages - Object does not
> support this property/method.

> So I want to add my own event which will notify VBscript that object
> is loaded and already initialized - e.g. Fire_Ready().

> Now the only problem is to find out where to raise this event...
> And this turned out to be pretty hard task.

> So if you know the answer or know where to look for it - may I ask you
> to help?



Sat, 30 Apr 2005 07:13:13 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Firing Events in ATL ActiveX in wince

2. Lots of trouble getting my ActiveX events to fire under ATL

3. ATL ActiveX Control Event not firing in IE?

4. ATL COM Component firing events into VBScript event sink

5. Once again ATL Server

6. NET Interop and ATL DCOM Server Events (once more)

7. NET Interop and ATL DCOM Server Events (once more)

8. I am searching an algorithm for testing all possibilities in an 2D-array

9. ATL DLL event sink with a VB ActiveX DLL event source

10. ActiveX Control - Fire Events

11. How to catch events fired by VB-written ActiveX DLL in VC++ client

12. Firing ActiveX events in MFC?

 

 
Powered by phpBB® Forum Software