Click to See Complete Forum and Search --> : events from dynamic object


Nilanjan
February 11th, 1999, 03:09 AM
Can anyone tell me how can I trap events from dynamic activex control object(object created using createobject() method) .

Thanks in advance

Nilanjan

Chris Eastwood
February 11th, 1999, 02:13 PM
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

Cimperiali
July 21st, 2004, 04:38 PM
Back from deep.
Nice to read from you, Chris
:wave: