Link to home
Start Free TrialLog in
Avatar of extramayo
extramayo

asked on

findfirstchangenotification in windows 95/98

I coded and tested my program in Windows XP. I began testing it on Windows 95/98, but discovered that findfirstchangenotification sets a variable to -1 on 95/98. This seems like an error to me, especially when the folder change events are not occurring. Is there something I'm missing? I tried the same path (on local machine) on both computers.
Avatar of extramayo
extramayo

ASKER

Okay, the handle is not created (-1 result) when the subfolders argument is set to true:

NotifyCreate = FindFirstChangeNotification(lpPathName, blnSubTree, FLAGS)

...where blnSubTree = True

It works fine, but without detecting folder changes of subfolders of the lpPathName folder. Any ideas?
And, I've discovered the Subtree arguement is a long, not a boolean... what are the values for it though?
One last followup. To clarify: findfirstchangenotifiction sets handle to -1 if subtree is true and returns normal value if set to false. This problem occurs only on a windows 98 machine.
ASKER CERTIFIED SOLUTION
Avatar of anthonywjones66
anthonywjones66

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, that was it.

Public Function NotifyCreate(lpPathName As String, blnSubTree As Boolean, FLAGS As Long) As Long

Dim lngSubTree

' convert boolean to C boolean -1&0 -> 1&0
If blnSubTree = True Then
    lngSubTree = 1
Else
    lngSubTree = 0
End If

NotifyCreate = FindFirstChangeNotification(lpPathName, lngSubTree, FLAGS)

End Function