Here is the code section I am getting an error on
------------------------------------------
'create a watcher for each file type and hook it to the event subs
Dim i As Integer
For i = 0 To UBound(FileType s) 'FileTypes is a string array with
stuff like "*.doc" in the arrays
ReDim Preserve Watchers(i)
Watchers(i) = New FileSystemWatch er
With Watchers(i)
.Filter = FileTypes(i).To String
.EnableRaisingE vents = True
.IncludeSubdire ctories = True
.InternalBuffer Size = 1277592
.NotifyFilter = IO.NotifyFilter s.DirectoryName Or
IO.NotifyFilter s.LastWrite Or IO.NotifyFilter s.FileName Or
IO.NotifyFilter s.Size Or IO.NotifyFilter s.Attributes
'add handlers
AddHandler Watchers(i).Cha nged, AddressOf watch_changed
AddHandler Watchers(i).Cre ated, AddressOf watch_changed
AddHandler Watchers(i).Del eted, AddressOf watch_changed
AddHandler Watchers(i).Ren amed, AddressOf watch_renamed
End With
Next
------------------------------------------
The error that I get is "The path is not of a legal form." and it points to
the ".EnableRaising Events = True" line of code.
The online help is generic and of no use at all.
I don't get it. There is no "path" here. EnableRaisingEv ents does not
require a "path" argument only a boolean.
Without this line, no events are triggered and the code is useless.
Can somebody help me figure this one out? PLEEEEEEASE?
------------------------------------------
'create a watcher for each file type and hook it to the event subs
Dim i As Integer
For i = 0 To UBound(FileType s) 'FileTypes is a string array with
stuff like "*.doc" in the arrays
ReDim Preserve Watchers(i)
Watchers(i) = New FileSystemWatch er
With Watchers(i)
.Filter = FileTypes(i).To String
.EnableRaisingE vents = True
.IncludeSubdire ctories = True
.InternalBuffer Size = 1277592
.NotifyFilter = IO.NotifyFilter s.DirectoryName Or
IO.NotifyFilter s.LastWrite Or IO.NotifyFilter s.FileName Or
IO.NotifyFilter s.Size Or IO.NotifyFilter s.Attributes
'add handlers
AddHandler Watchers(i).Cha nged, AddressOf watch_changed
AddHandler Watchers(i).Cre ated, AddressOf watch_changed
AddHandler Watchers(i).Del eted, AddressOf watch_changed
AddHandler Watchers(i).Ren amed, AddressOf watch_renamed
End With
Next
------------------------------------------
The error that I get is "The path is not of a legal form." and it points to
the ".EnableRaising Events = True" line of code.
The online help is generic and of no use at all.
I don't get it. There is no "path" here. EnableRaisingEv ents does not
require a "path" argument only a boolean.
Without this line, no events are triggered and the code is useless.
Can somebody help me figure this one out? PLEEEEEEASE?
Comment