I created a custom Activex control and managed to compile it to an ocx. The control seems to work properly if it is the only one on a form. If I put to controls on the form (I have tried a control array and calling them different names) the controls mess up. The seem to screw up in the events that they raise.
Below is the code in the test project that calls the ocx. If there is only one control it works like it is supposed to. With the two controls as in the code below, the fileDone and ioerror events do not seem to work. It's as if visual basic is confused as to which control raised the event.
'======
Option Explicit
Private Sub cmdCopy_Click()
FileCopy1.Copy
FileCopy2.Copy
End Sub
Private Sub Form_Load()
FileCopy1.SetText "c:\TEMP\test\98112700.h24", "c:\TEMP\98112700.h24"
FileCopy2.SetText "c:\TEMP\test\dwSnowman.avi", "c:\TEMP\dwSnowman.avi"
End Sub
Private Sub filecopy1_fileDone(fName As String)
MsgBox fName
End Sub
Private Sub FileCopy1_ioerror(errMesg As String)
MsgBox errMesg
End Sub
Private Sub filecopy2_fileDone(fName As String)
MsgBox fName
End Sub
Private Sub FileCopy2_ioerror(errMesg As String)
MsgBox errMesg
End Sub
'============
My goal with this control is to get it to work like the winsock control (multi threaded). what would be the best way to reach this goal....
Troy Williams B.Eng.
fenris@hotmail.com
Below is the code in the test project that calls the ocx. If there is only one control it works like it is supposed to. With the two controls as in the code below, the fileDone and ioerror events do not seem to work. It's as if visual basic is confused as to which control raised the event.
'======
Option Explicit
Private Sub cmdCopy_Click()
FileCopy1.Copy
FileCopy2.Copy
End Sub
Private Sub Form_Load()
FileCopy1.SetText "c:\TEMP\test\98112700.h24", "c:\TEMP\98112700.h24"
FileCopy2.SetText "c:\TEMP\test\dwSnowman.avi", "c:\TEMP\dwSnowman.avi"
End Sub
Private Sub filecopy1_fileDone(fName As String)
MsgBox fName
End Sub
Private Sub FileCopy1_ioerror(errMesg As String)
MsgBox errMesg
End Sub
Private Sub filecopy2_fileDone(fName As String)
MsgBox fName
End Sub
Private Sub FileCopy2_ioerror(errMesg As String)
MsgBox errMesg
End Sub
'============
My goal with this control is to get it to work like the winsock control (multi threaded). what would be the best way to reach this goal....
Troy Williams B.Eng.
fenris@hotmail.com