Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Values Returned by Win32API With WNetAddConnection
Message
 
To
15/12/2000 19:10:13
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00454296
Message ID:
00454312
Views:
28
>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

Yes, it should have a colon (:). The following should provide the answer to your question about the various error values:
* Network Errors
#DEFINE NO_ERROR		       0    && No error occurred.
#DEFINE ERROR_ACCESS_DENIED	       5    && Access is denied.
#DEFINE ERROR_NOT_ENOUGH_MEMORY	       8    && Insufficient Memory
#DEFINE ERROR_BAD_DEV_TYPE	      66    && The device type and the resource type do not match.
#DEFINE ERROR_BAD_NET_NAME	      67    && The value specified in the lpszRemoteName parameter is not valid or cannot be located.
#DEFINE ERROR_ALREADY_ASSIGNED            85    && The device specified in the lpszLocalName parameter is already connected.
#DEFINE ERROR_BAD_DEVICE                1200    && The value specified in lpszLocalName is invalid.
#DEFINE ERROR_DEVICE_ALREADY_REMEMBERED 1202    && An entry for the device specified in lpszLocalName is already in the user profile.
#DEFINE ERROR_NO_NET_OR_BAD_PATH        1203    && The operation cannot be performed because either a network component is not started or the specified name cannot be used.
#DEFINE ERROR_CANNOT_OPEN_PROFILE       1205    && The system is unable to open the user profile to process persistent connections.
#DEFINE ERROR_BAD_PROFILE               1206    && The user profile is in an incorrect format.
#DEFINE ERROR_EXTENDED_ERROR            1208    && A network-specific error occurred. To get a description of the error, use the WNetGetLastError function.
#DEFINE ERROR_INVALID_PASSWORD          1216    && The specified password is invalid.
#DEFINE ERROR_CANCELLED                 1223    && The user cancelled
#DEFINE ERROR_NO_NETWORK                2138    && The network is not present.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform