Click to return to the Networking, Protocols     
Gopher Functions     GopherFindFirstFile Funct...     Gopher Functions    
Web Workshop  |  Networking, Protocols & Data Formats

GopherCreateLocator Function


Creates a Gopher or Gopher+ locator string from its component parts.

Syntax

BOOL GopherCreateLocator(
    IN LPCSTR lpszHost,
    IN INTERNET_PORT nServerPort,
    IN LPCTSTR lpszDisplayString,
    IN LPCTSTR lpszSelectorString,
    IN DWORD dwGopherType,
    OUT LPTSTR lpszLocator,
    IN OUT LPDWORD lpdwBufferLength
);

The actual syntax of this function varies between its ANSI and Unicode implementations. For more information, see Win32 Internet Functions Syntax.

Parameters

lpszHost
Address of a string that contains the name of the host, or a dotted-decimal IP address (such as 198.105.232.1).
nServerPort
Port number on which the Gopher server at lpszHost lives, in host byte order. If nServerPort is INTERNET_INVALID_PORT_NUMBER, the default Gopher port is used.
lpszDisplayString
Address of a string that contains the Gopher document or directory to be displayed. If this parameter is NULL, the function returns the default directory for the Gopher server.
lpszSelectorString
Address of the selector string to send to the Gopher server in order to retrieve information. This parameter can be NULL.
dwGopherType
Unsigned long integer value that specifies whether lpszSelectorString refers to a directory or document, and whether the request is Gopher+ or Gopher. The default value, GOPHER_TYPE_DIRECTORY, is used if the value of dwGopherType is zero. This can be one of the Gopher Type Values.
lpszLocator
Address of a buffer that receives the locator string. If lpszLocator is NULL, lpdwBufferLength receives the necessary buffer length, but the function performs no other processing.
lpdwBufferLength
Address of an unsigned long integer value that contains the length of the lpszLocator buffer, in TCHARs. When the function returns, this parameter receives the number of TCHARs written to the lpszLocator buffer. If GetLastError returns ERROR_INSUFFICIENT_BUFFER, this parameter receives the number of bytes required to form the locator successfully.

Return Value

Returns TRUE if successful, or FALSE otherwise. To get extended error information, call GetLastError or InternetGetLastResponseInfo.

Remarks

To retrieve information from a Gopher server, an application must first get a Gopher "locator" from the Gopher server.

The locator, which the application should treat as an opaque token, is normally used for calls to the GopherFindFirstFile function to retrieve a specific piece of information.

Function Information

Windows NT Use version 4.0. Implemented as ANSI and Unicode functions.
Windows Use Windows 95 and later. Implemented as ANSI and Unicode functions.
Header Wininet.h
Import library Wininet.lib
Minimum availability Internet Explorer 3.0 (ANSI only), 5 (ANSI and Unicode)

See Also

Microsoft Win32 Internet Functions Overview, Gopher Sessions, Microsoft Win32 Internet Functions Reference, Gopher Functions



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.