This function provides a programmatic means to add a server to the local list of servers supported by the pilogin DLL. This function does not require pilg_registerapp to be called and is particularly useful for installation programs.

C format

PIINT32 pilg_addnewserver (

LPSTR lpszServerName,

UINT nServerType,

LPSTR lpszUserName,

int32 nPortNum );


The node identifier for the newly added server if successful otherwise


User dialog cancelled


Login.ini location unwritable


Can’t find pipc.ini (32 bit)


Can’t find windows directory (32 bits)


pipc.ini has neither PIPCSHARE nor PIHOME


Server already exists


Invalid server type


lpszServerName (passed)

Null terminated string indicating the name of the server to be added to the locally stored list of servers accessed through the pilogin.dll. Passing a null string will invoke a dialog box prompting the user for server information.

nServerType (passed)

Unsigned integer representing the type of server being added. Currently only PI Servers are recognized. Use the defined constant PILOGIN_SERVER_TYPE_PI from pilogex.h

lpszUserName (passed)

Null terminated string containing the default user name which pilogin will use with this server.

nPortNum (passed)

The port number on which this new server listens. Typically for PI2 servers this will be 545 and for PI3 (Windows NT and UNIX) servers this will be 5450.

Usage Notes

This function can be used by install programs to create pilogin DLL server entries. Passing a null string for the server name invokes the "Define Connection" dialog, allowing the user to specify server information.

Enabling Operational Intelligence