Hello!
After searching a lot, I did not find an example for handling events with an OleObject.
[code]Dim Obj As OleObject
Dim R As Variant
Dim P(3) As Variant
dim URL as String
URL = “http://…/wiki/asp/REST.asp?P={%22Method%22:%22Name%22,%20%22Nr%22:12345}”
Self.XMLHTTP = New OleObject(“Microsoft.XMLHTTP”)
Obj = Self.XMLHTTP
if Obj<>Nil then
//The following implemenation errors on OLEException (Type mismatch)
//Obj.Value(“onreadystatechange”) = AddressOf onReadyStateChangeXmlHttpRequest
//Of course, no static onreadystatechange available
//AddHandler Obj.onreadystatechange, AddressOf onReadyStateChangeXmlHttpRequest
P(1) = “GET”
P(2) = URL
P(3) = True
Obj.Invoke(“open”, P)
end if[/code]
How can I bind an event to an OleObject instance?
Is it done by AddHandler?
Any example would be helpful.
Thanks a lot,
regards