This function creates a reference to an Automation object that has events.
CreateObjectWithEvents(object, prefix)
Returns a reference to an Automation object that has events.
Use CreateObjectWithEvents to create non-visible ActiveX controls at run time. You cannot use CreateObjectWithEvents to create graphical objects such as a TreeView control or a ListView control. The following table lists the ProgID values for the ActiveX controls with events.
Control |
ProgID |
Microsoft CE Comm control 6.0 | CEcomm.comm |
Microsoft CE WinSock control 6.0 | WinSock.winSock |
The following code example shows how to use the prefix string to define object events.
Dim C1 as CECOMMCtl.Comm
Set C1 = CreateObjectWithEvents(“CECOMM.Comm”, “C1_”)
Public Sub C1_OnComm(…)
[…code for the OnComm event…]
End Sub