Programatically 'wake up' connection to remote disk?

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.
tullheadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

j-horbCommented:
I don't know if there is a more 'modern' solution, but this thread suggests a way of forcing a reconnect.

http://www.generation-nt.com/us/answer/reconnecting-disconnected-network-drive-help-27004822.html#r

( I think the problem is occuring because Windows disconnects a mapped drive after a period of inactivity. Accessing in Explorer forces a reconnect)
0
cupCommented:
Do your machines have "wake on LAN" network cards?  Have a look at http://gsd.di.uminho.pt/jpo/software/wakeonlan/mini-howto/

It means that as long as the machine has power, even if it has shutdown, it can be started up.

You can force windows not to disconnect by switching off the power save on the adapter.
0
tullheadAuthor Commented:
j-horb - this is exactly what I'm talking about.  It would be very hlepful to me to see a small bit of sample code - just looking at the definitions in MSDN is a little hard for me, though I may try to slug it out.  Know of any sample code?
0
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

j-horbCommented:
There is some example code on MSDN, e.g here (scroll down for the example).
0
j-horbCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tullheadAuthor Commented:
I haven't got around to try it, but it looks to be exactly what I need, so I'll declare this an good answer!  Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.