|
-
April 30th, 1999, 06:41 AM
#1
How can I get the UNC path of a drive ?
Hi,
I would like to get the UNC path of one drive for example for:
F:
Win on SERVER1-NT-PC
Or something like that ;-), How can I get this ?
Thanks, Bye !
Braulio
-
May 3rd, 1999, 03:05 AM
#2
Re: How can I get the UNC path of a drive ?
Hi Braulio!
The WNetGetUniversalName function takes a drive-based path for a network resource and obtains a data structure that contains a more universal form of the name. Look into the help for more details on how to use it.
Here is a piece of code which will help get the UNC path given the drive(in this case the drive letter E is given).
#include "winnetwk.h"
UNIVERSAL_NAME_INFO UNC;
DWORD dsize = 500;
WNetGetUniversalName("E:\\", UNIVERSAL_NAME_INFO_LEVEL,&UNC,(LPDWORD)&dsize);
AfxMessageBox(UNC.lpUniversalName);
Do let me know if it works.
Regards,
Sukanya Swaminathan
Software Engineer
Aditi Technologies
Blr - 80
Email : [email protected]
-
June 17th, 1999, 07:57 AM
#3
Re: How can I get the UNC path of a drive ?
Hello,
I tried to use WNetGetUniversalName, compiling works very well but linking failed with
Test.obj : error LNK2001: unresolved external symbol _WNetGetUniversalNameA@16
.
In the online-help I couldn't find any information about the need to add a lib for linking. Can you help me?
Thomas Wollny
-
June 17th, 1999, 10:56 AM
#4
Re: How can I get the UNC path of a drive ?
mpr.lib is what you should link with.
Happy Coding
-
June 18th, 1999, 01:40 AM
#5
Re: How can I get the UNC path of a drive ?
Thanks John,
it seems I was blind, I looked 5 times into the Quick Info but didn't see the line "Import Library mpr.lib". Next time I will look better.
Thomas Wollny
-
June 18th, 1999, 04:19 AM
#6
Re: How can I get the UNC path of a drive ?
Hello Braudio,
Try this:
GetComputerName(lpszValue, &dwSize);
It works for me.
David Chan
-
June 18th, 1999, 07:45 AM
#7
Re: How can I get the UNC path of a drive ?
I tried this for practice and it works fine, the message box appears with the full name of the selected drive
however after that when I leave the
-
December 2nd, 1999, 09:14 PM
#8
Re: How can I get the UNC path of a drive ?
hi,
i too receiving the same error message during linking. But my requirement is on Win95. the quickinfo says its only supported on WinNT.
Can you guys help me out.
Maruthi Chirala
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
|