NWCCOpenConnByName

Resolves the given server or tree name to a network address then creates a connection to that address

NetWare Server:3.x, 4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform Client (CLX*.*)
Service:Connection

Syntax

C

  #include <nwclxcon.h> 
   
  N_EXTERN_LIBRARY NWRCODE NWCCOpenConnByName ( 
     NWCONN_HANDLE       startConnHandle,  
     const nstr8 N_FAR  *name,  
     nuint               nameFormat,  
     nuint               openState,  
     nuint               tranType,  
     pNWCONN_HANDLE      pConnHandle);
  

Delphi

  uses clxwin32 
   
  Function NWCCOpenConnByName 
    (startConnHandle : NWCONN_HANDLE;           
     name : pnstr8;                                
     nameFormat : nuint;                         
     openState : nuint;                        
     tranType : nuint;                         
     Var pConnHandle : NWCONN_HANDLE               
  ) : NWRCODE;
  

Parameters

startConnHandle
(IN) Specifies the connection to use when resolving the name.
name
(IN) Points to the name of the server or tree to connect to.
nameFormat
(IN) Specifies the format of the server or tree to connect to (see Section 5.9, Name Format Values).
openState
(IN) Specifies the desired open state of the connection (see Section 5.2, Connection State Values).
tranType
(IN) Specifies the transport type (see Section 5.12, Transport Type Values) and "Remarks" below.
pConnHandle
(OUT) Points to the connection handle to be returned and may be used for all requests directed to the connection.

Return Values

These are common return values; see Return Values (Return Values for C) for more information.

0x0000

SUCCESSFUL

0x8801

NWE_CONN_INVALID

0x8808

NWE_SERVER_NO_SLOTS

0x880A

NWE_SERVER_NO_ROUTE

0x883F

NWE_CONN_TABLE_FULL

0x8841

NWE_TRAN_INVALID_TYPE

0x8847

NWE_SERVER_NOT_FOUND

0x8867

NWE_INSUFFICIENT_RESOURCES

0x8868

NWE_STRING_TRANSLATION

0x8869

NWE_ACCESS_VIOLATION

0x8870

NWE_UNSUPPORTED_TRAN_TYPE

0x8904

The server name is invalid.

0x890A

NLM_INVALID_CONNECTION

0xAF7E

The tree and server name combination is invalid.

Remarks

startConnHandle is the connection to use when resolving a name. For instance, if the name is a bindery name, the requester will scan the bindery of the given connection for the required server name.

startConnHandle can also be zero if you do not care which connection is used to resolve the name.

name points to the structure containing the name of the server to which to connect. The format and length of these strings are defined by nameFormat.

For the tranType parameter, Novell recommends passing NWCC_TRAN_TYPE_WILD and letting the underlying system use the type best suited for the connection it is making. The other type values remain available, however.

NOTE:Under NETX and VLM, tranType can only be set to either NWCC_TRAN_TYPE_IPX or NWCC_TRAN_TYPE_WILD. Otherwise, NWCCOpenConnByName will return NWE_UNSUPPORTED_TRAN_TYPE.

See openconn.c for sample code.

See Also

NWCCCloseConn, NWCCOpenConnByPref, NWCCOpenConnByRef