LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

unmapping network drive on CVI

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(2,970 Views)
Solution
Accepted by topic author Laser

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_03-25_15-00-49.png

 

NickB

National Instruments

Message 2 of 3
(2,958 Views)

Thank you very much Nick, it is exactly what I need!

 

As often Microsoft provides solutions a little bit twisted...

 

Again thanks

Sergio

0 Kudos
Message 3 of 3
(2,933 Views)