|
-
May 4th, 2001, 03:32 PM
#1
how to use map a network drive?
Does anyone know how to programmatically map a network drive? It looks like one would use the function NetUseAdd(), but it is not working. This is what I tried:
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
USE_INFO_1 ui1;
DWORD dwParmError;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
ui1.ui1_local = _T("E:");
ui1.ui1_remote = _T("\\\\FPGHEB001NWR\\SHARED");
ui1.ui1_password = NULL;
ui1.ui1_asg_type = USE_DISKDEV;
::NetUseAdd( NULL, 1, (UCHAR*) &ui1, &dwParmError);
}
return nRetCode;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|