LInet::GetPrevItem

#include "ltwrappr.h"

LInet * LInet::GetPrevItem(plRemoteComp, bByType=FALSE)

LInet * plRemoteComp;

/* instance of a remote computer */

L_BOOL bByType;

/* flag that indicates the previous item to get */

Retrieves the previous remote computer in the connection list, based on the specified parameters.

Parameter

Description

plRemoteComp

Instance of the remote computer currently referenced in the connection list.

bByType

Flag that indicates the next item to get. Possible values are:

 

Value

Meaning

 

TRUE

Get the previous remote computer in the internal connection list that has the same type (server or client) as plRemoteComp.

 

FALSE

Get the previous remote computer in the internal connection list, regardless of type.

Returns

A pointer to an LInet object that references the previous remote computer.

Comments

If bByType = FALSE, this function will get the previous remote computer in the internal connection list, either SERVER or CLIENT.

If bByType = TRUE, this function will get the previous remote computer in the internal connection list that has the same type as plRemoteComp.

Do not delete plRemoteComp.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ExistsItem, LInet::GetItem, LInet::GetFirstItem, LInet::GetLastItem, LInet::GetNextItem, LInet::GetItemsCount, Class Members

Example

// a user defined class derived from LInet should be used to support the OnConnect callback functions
// suppose it was named as LUserInetGPI
class LUserInetGPI : public LInet
{
protected:
   virtual  L_INT OnConnect(LInet *plConnection, L_INT nError);
};
L_INT LInet__GetPrevItemExample()
{
   L_INT          nRet;
   LUserInetGPI   UserInet;
   // other operations
   // connect to LEAD
   nRet = UserInet.Connect("207.238.49.190", 1000);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}
L_INT LUserInetGPI::OnConnect(LInet *plConnection, L_INT nError)
{
   UNREFERENCED_PARAMETER(nError);
    LInet*     plRemote = NULL;
    L_CHAR*    pName;
    L_TCHAR    szString[256];
    plRemote = GetPrevItem(plConnection);
    if (plRemote != NULL)
    {
        pName = plRemote->GetHostName();
        wsprintf(szString, TEXT("Host name for pervious connection: %s"), pName);
        MessageBox(NULL, szString, TEXT(""), MB_OK);
    }
    return SUCCESS;
}