Thanks for the reply. I have permission to the share: I'm able to save a
file to that share from within Word. I'm using the following code:
void FileWatcher::SetFile(String* fullPathName)
{
FileInfo* fi = new FileInfo(fullPathName);
m_watcher->Path = fi->DirectoryName;
m_watcher->EnableRaisingEvents = true;
m_watcher->Filter = fi->Name;
}
and the exact exception is:
A "System.NullReferenceException" occured.
Object reference not set to an instance of an object.
and it occurs on this line:
m_watcher->Path = fi->DirectoryName;
and fi->DirectoryName returns \\Pdc1\cdrive\.
I was doing some searching on the net about the FileSystemWatcher and found
this link:
http://msdn.microsoft.com/library/de...t4machines.asp
It sounds like FileSystemWatcher has a few problems with network file
watching.
Thanks again and let me know what you think. Jon.
"Michael Giagnocavo [MVP]" <mg*******@Atrevido.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
First question: Do you have permissions to that share?
Second: please post the full exception and stack trace along with a small
bit of code.
Thanks,
-mike
MVP
"jlea" <jo*@leapsoft.com> wrote in message
news:Op**************@TK2MSFTNGP11.phx.gbl... I'm trying to watch a file from my XP-Pro workstation to either a
Win2000 or a NT4 machine and everytime I try to set the path property to something
such as \\PDC1\cdrive\ I get a system.nullException error.
Anyone have any ideas? Does this work? It works just fine on my local
machine: "c:\abc\def\"
Thanks. Jon Lea