0

This question is the same as this one, except for C++.

What is the best way to ensure an initial connection has been made to a network drive before using the path in the software ?

Edit:

To expand a little:

Is/Why isn't there a function like InitNetworkDriveConnections() ?

Community
  • 1
  • 1
Smash
  • 3,722
  • 4
  • 34
  • 54
  • 2
    What's wrong with the answer on the original question? You can just implement the same thing in C++? – Mats Petersson Aug 12 '13 at 16:00
  • Can't you just try to use it and see if it errors/throws? – Martin James Aug 12 '13 at 16:04
  • Just wondering if there is a better solution, i.e. InitNetworkDriveConnections() or why doesn't a function like that one exist? – Smash Aug 12 '13 at 16:04
  • @MartinJames yes, but the point is to do the connection so I can use it, not just test – Smash Aug 12 '13 at 16:05
  • There used to be such a function that was documented for use prior to Windows Vista, called [`WNetRestoreConnectionW`](http://msdn.microsoft.com/en-us/library/windows/desktop/aa385480(v=vs.85).aspx). If you require compatibility with Vista and later versions of the operating system you will find a fully-coded workaround in the comments section of the linked page as well. Caveat emptor. – Nik Bougalis Aug 12 '13 at 16:19

0 Answers0