|
-
Mar 26th, 2003, 01:20 PM
#1
Thread Starter
Lively Member
Dynamic OCX Event does not fire
I have a custom built ocx, when the ocx is dragged onto a form and I trigger the Event it works but when I recreate the control with either early or late binding I cannot triiger the Event.
'Form version with ocx dragged onto form
Private Sub Command1_Click()
m_MyOcx.PerformOperation 9, 0
'This is a dummy operation that causes the Event to be fired.
End Sub
Private Sub m_MyOcx_OperationCompleted(ByVal nOperationID As Long, ByVal nExitCode As Long, ByVal nUserID As Long)
MsgBox "Fire!"
End Sub
The above works as intended.
Below does not work
Dim m_MyOcx As Object
Private Sub Command1_Click()
m_MyOcx.PerformOperation 9, 0
End Sub
Private Sub Form_Load()
Set m_MyOcx = CreateObject("MyOcx.MyOcx.1")
'Set m_MyOcx = New MyObjectName
End Sub
Private Sub m_MyOcx_OperationCompleted(ByVal nOperationID As Long, ByVal nExitCode As Long, ByVal nUserID As Long)
MsgBox "Fire!"
End Sub
I've also used late and early binding with no positive results.
Any help is appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|