LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping a disk on another network

I want to run a LabVIEW application which needs to map a disk on another network. I want to use WNetAddConnection2 from mpr.dll.
I have valid accounts on both networks and I succeeded the mapping in Windows Explorer.
In LabVIEW I didn't succeed, probably because of the way I am transmiting the NETRESOURCE structure to the DLL. If passing like a LabVIEW cluster I'm obtaining error code 1200. If passing like in "CLUSTERSimpleS_A.vi" I get error code 487. These error codes are obtained no matter what values I'm using for dwScope, dwType, dwDisplayType and dwUsage.
Any help, please ?
0 Kudos
Message 1 of 2
(2,907 Views)
Hello Tom,

The WNetAddConnection2 needs a NETRESOURCE structure as a input and if you try using Cluster in LabVIEW, it might not work. The best workaround would be creating a C Wrapper that takes in the various data types and converts them to a structure that can be used with the DLL function call.

An easier alternative would be using the "net use" command in "System Exec.vi" for this application. More information on the use can be found at http://digital.ni.com/public.nsf/websearch/313C5E597B48652F86256D2700674EDB?OpenDocument

I hope this helps,
Rajiv
0 Kudos
Message 2 of 2
(2,907 Views)