03-25-2011 10:58 AM
Hello All,
Inside a CVI 8.1.1 program, I'd need to discover if the letter of a logical drive, hides a mapped network drive or not.
For example, I'd like to know if f:\mydir is really a directory of my local hard disk f: or if it is \\server\mydir (where \\server is mapped as f:)
Any ideas?
Thanks alot
Sergio
Solved! Go to Solution.
03-25-2011 03:02 PM
Hello -
There's not a way to do this with any LabWindows/CVI API, but you can do with the Win32 SDK. In particular, you will need the functions GetLogicalDriveStrings (or GetLogicalDrives) and the function GetDriveType.
If you need to retrieve the actual UNC path corresponding to the drive letter, you need to use the WNetOpenEnum and WNetEnumResource functions. Using these functions will require the full development version of LabWindows/CVI. You will also need to add Mpr.lib to your project to link in these functions.
I've written a small example application that gives the following output on my machine. Take a look at the attached code (it's a little rough, no error checking etc.) and let me know if you have any questions. To build the code, you will need to add mpr.lib to you project (which requires CVI full development system).
NickB
National Instruments
03-28-2011 01:59 AM
Thank you very much Nick, it is exactly what I need!
As often Microsoft provides solutions a little bit twisted...
Again thanks
Sergio