Class Code Option ExplicitDim WithEvents objFrm As Form1Public Event FileFount (ByVal FileName As String) Public Event FileNotFount (ByVal N As Long) Private Sub Class_Initialize () '// initialize set Set objFrm = Form1End Sub
Public SUB SetFile '// Settings the file you want to facilitate objfrm.strfilename = strfile objfrm.timer1.Interval = 20END SUB
Private sub class_terminate () endend sub
Private sub objfrm_filefound () raiseevent filefount (objfrm.strfilename) End Sub
Private Sub objFrm_FileNotFound () RaiseEvent FileNotFount (objFrm.Falgs) End Sub Form Code Option ExplicitPublic strFileName As String '// files to monitor Public Event FileFound ()' // find Public Event FileNotFound () '// not found Public Falgs As IntegerPrivate Sub Timer1_Timer () If strFileName = "" Then Exit Sub If Dir $ (strFileName) <> "" Then RaiseEvent FileFound '// find Falgs = 0 Else RaiseEvent FileNotFound' // find no Falgs = Falgs 1 End IfEnd Sub Interpretation: Define two events when two events are triggered when the events defined in the form. The event in the trigger class is in the user's side. This event ActiveX EXE and Acitvex DLL distinguish ActiveX EXE this does not affect the main program ActiveX DLL in the process. This impact is always in ActiveX EXE. It can be performed at the same time. Multithreaded ActiveX DLL is not. The DLL is executed after the DLL is executed. The main program "ActiveX DLLS is running within the process, and ActiveX EXES is running outside the process."