Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared directories - API-function????

Status
Not open for further replies.

Denaeghel

Programmer
Apr 23, 2001
61
BE
Is there an API-function that gives the possibility to make connection with shared directories (network).
 
Here is the function that i have used in C and it should work in VB but I'm not good a translating from C to VB.
The Function is WNetAddConnection2 this allows you to map a drive letter to a shared folder. The definition of this API call is in the Win32 API help file.

Following is the function definition in C for anyone who can translate it:
DWORD WNetAddConnection2(

LPNETRESOURCE lpNetResource, // points to //structure that specifies //connection details
LPCTSTR lpPassword, // points to password string
LPCTSTR lpUsername, // points to user name string
DWORD fdwConnection // set of bit flags that specify // connection options
);

The LPNETRESOURCESTRUCTURE :
typedef struct _NETRESOURCE { // nr

DWORD dwScope;
DWORD dwType;
DWORD dwDisplayType;
DWORD dwUsage;
LPTSTR lpLocalName;
LPTSTR lpRemoteName;
LPTSTR lpComment;
LPTSTR lpProvider;
} NETRESOURCE;

The Function is located in the MPR.LIB Library
Hope This Helps

Jonathan Houston
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top