Information générale
Catégorie:
Contrôles ActiveX
Titre:
ActiveX DLL and Event Handler
Hi all,
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.IQueryCmd
Set bb = New BossCheckerOject.IQueryCmd
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?
Thanks in advance...
Chris
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement