Can anyone tell me how can I trap events from dynamic activex control object(object created using createobject() method) .
Thanks in advance
Nilanjan
Printable View
Can anyone tell me how can I trap events from dynamic activex control object(object created using createobject() method) .
Thanks in advance
Nilanjan
Hi
If you have a reference to your object set in the project then you should be
able to declare it in the usual way :
Private WithEvents mObj As XXX.XXX
Set mObj = CreateObject("XXX.XXX")
This will then set the reference to the object so that it can still get events.
If you're declaring your object as
Private X as Object
Set X = CreateObject(......)
Then there's no way for VB (or COM for that matter) to know anything about the
events that it can raise.
Another way would be for the external object to implement an interface so that
you could have call back facilities inside the object.
Regards
Chris Eastwood
CodeGuru - The website for developers
http://www.codeguru.com/vb
Back from deep.
Nice to read from you, Chris
:wave: