Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Values Returned by Win32API With WNetAddConnection
Message
From
15/12/2000 19:10:13
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Values Returned by Win32API With WNetAddConnection
Miscellaneous
Thread ID:
00454296
Message ID:
00454296
Views:
92
What mean those values Returned by Win32API when I execute WNetAddConnection ?

Declare integer WNetAddConnection in WIN32API string,string,string
drive_letter = "G:"
share_name = "\\boss500\"
z=WNetAddConnection(share_name, "", Drive_Letter)

sometimes z = 1200, 85, 67 or 0

Or using this other function:

SET LIBRARY TO SYS(2004)+'FOXTOOLS.FLL' ADDITIVE

LOCAL xaddconn, xh, xservidor, xletra
xaddconn=RegFn('WNetAddConnection','CCC','I')

share_name = "\\boss500"
drive_letter = "G:"
x=CallFn(xaddconn,share_name,"",drive_letter)
? x

I know that if I put (:) at the end of the drive letter
the return value is diferrent.
Must the drive letter for those function have the (:) at the end or not ?
I'm asking because in Windows Script Host (Wscript) doesnt comes with the (:) at the end.
I havent found what the return values of WNetAddConnection mean.

Sample:
ONET = CREATEOBJECT("WScript.Network")
oNetDrives = ONET.EnumNetworkDrives
FOR lni = 0 TO oNetDrives.COUNT - 1 STEP 2
? oNetDrives.ITEM(lni)
ENDFOR

and oNetDrives.ITEM(lni) returns => "\\BOSS500\E" without (:)
Does it makes difference if Win is 9x, ou Win2K ?

Thank's in Advance
Next
Reply
Map
View

Click here to load this message in the networking platform