ActiveX DLL - Event Handler problem
Hi. This is the first time that I post a message in this forum. Hope someone could give me a helping hand on this:
I have wrote a ActiveX DLL using VB6. And then I wrote a client program which use this ActiveX DLL
Here is the sample code for the client program
==========================
Option Explicit
Private WithEvents aa As BossCheckerOject.IQueryCmd
Private WithEvents bb As BossCheckerOject.IQueryCmd
Private Sub aa_DataArrival()
MsgBox "aaaa"
End Sub
Private Sub bb_DataArrival()
MsgBox "bbbbb"
End Sub
Private Sub Command1_Click()
Set aa = New BossCheckerOject.QueryCmd
Set bb = New BossCheckerOject.QueryCmd
aa.strBossIp = "127.0.0.1"
aa.strBossPort = "10000"
aa.m_intLocaleId = 2052
aa.SetRequestMsg "20050", "13922200525~6006~1"
aa.SendQuery
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set aa = Nothing
Set bb = Nothing
End Sub
===================
The object I wrote "BossCheckerOject.QueryCmd" would fire a DataArrival event. I used the "aa" object to send a query out. I expected that I should received an event from the "aa" object. But then the event handler of "bb" handle the event.
Do you have any idea of what's going on?
Chris