LInet::GetPrevItem
#include "ltwrappr.h"
LInet L_FAR * LInet::GetPrevItem(plRemoteComp, bByType=FALSE)
/* 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 LUserInet
LUserInet UserInet;
// other operations
// connect to LEAD
UserInet.Connect("207.238.49.190", 1000);
L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
LInet L_FAR *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;
}