L_InetGetHostName
#include "l_bitmap.h"
#include "ltnet.h"
L_INT EXT_FUNCTION L_InetGetHostName(hComputer, pszName, nType, pulBufferLength)
L_COMP hComputer; |
/* handle of remote computer */ |
/* address of buffer to update */ | |
L_INT nType; |
/* type of name to retrieve */ |
/* address of a variable to be updated with the length of pszName */ |
Gets either the descriptive name (URL) or the IP address of a remote computer.
Parameter |
Description |
|
hComputer |
Handle of the remote computer for which hostname should be retrieved |
|
pszName |
Address of the buffer to update with the hostname character string |
|
nType |
Value indicating the type of name to retrieve. Possible values include: |
|
|
Value |
Meaning |
|
HOST_NAME_DESCRP |
descriptive name of remote computer |
|
HOST_NAME_IP |
IP address of remote computer |
pulBufferLength |
Address of a variable to be updated with the required length of the buffer to hold the hostname string. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
hComputer has to be connected for this function to return SUCCESS.
If pszName is NULL, then pulBufferLength will be updated with the required size of the buffer to hold the hostname string. The size will take into account the terminating NULL character.
If pszName is not NULL, then pulBufferLength contains the size of the string copied into pszName. The string will be truncated if the buffer pointed to by pszName is not large enough to contain the entire hostname string.
You must initialize the LEADTOOLS Internet DLL using L_InetStartUp before calling this function.
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: |
L_InetConnect, L_InetServerInit, L_InetClose, L_InetStartUp, L_InetShutDown |
Topics: |
Example
For an example, refer to L_InetConnect.