Programatically 'wake up' connection to remote disk?
Posted on 2010-03-26
My application ( C++, MFC, MS 6.0 ) when attempting to open a file, will make a call on using CFileStatus to see if it exists. If it does, I open it. No issue on local disks. However, often, but not always, my app will say that a file on a networked disk does not exist. If I go out to windows, and surf over to that remote disk, opening it once -- then my app will be able to open the file on that remote disk. It will continue working for a while, but at some point, it again fails.
Maybe because someone rebooted the remote system, maybe something times out, not sure.
The point is, I would like to programmatically do the equivalent of what I do manually when I go to 'My Computer', and click on the remote disk, which seems to 'wake up' the connection to it.
In case it helps, I always have a "drive letter" defined to these remote disks.