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

GopherFindFirstFile Function


Uses a Gopher locator and some search criteria to create a session with the server and locate the requested documents, binary files, index servers, or directory trees.

Syntax

HINTERNET GopherFindFirstFile(
    IN HINTERNET hConnect,
    IN LPCTSTR lpszLocator,
    IN LPCTSTR lpszSearchString,
    OUT LPGOPHER_FIND_DATA lpFindData,
    IN DWORD dwFlags,
    IN DWORD_PTR dwContext
);

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

Parameters

hConnect
Handle to a Gopher session returned by InternetConnect.
lpszLocator
Address of a string containing the name of the item to locate. This can be one of the following items:
  • Gopher locator returned by a previous call to this function or the InternetFindNextFile function.
  • NULL pointer or zero-length string indicating that the topmost information from a Gopher server is being returned.
  • Locator created by the GopherCreateLocator function.
lpszSearchString
Address of a buffer that contains the strings to search, if this request is to an index server. Otherwise, this parameter should be NULL.
lpFindData
Address of a GOPHER_FIND_DATA structure that receives the information retrieved by this function.
dwFlags
Unsigned long integer value containing the flags controlling the function behavior. This can be a combination of the following values:
INTERNET_FLAG_HYPERLINK
INTERNET_FLAG_NEED_FILE
INTERNET_FLAG_NO_CACHE_WRITE
INTERNET_FLAG_RELOAD
INTERNET_FLAG_RESYNCHRONIZE
dwContext
Address of an unsigned long integer value containing the application-defined value that associates this search with any application data.

Return Value

Returns a valid search handle if successful, or NULL otherwise. To get extended error information, call GetLastError or InternetGetLastResponseInfo.

Remarks

GopherFindFirstFile closely resembles the Win32® FindFirstFile function. It creates a connection with a Gopher server, and then returns a single structure containing information about the first Gopher object referenced by the locator string.

After calling GopherFindFirstFile to retrieve the first Gopher object in an enumeration, an application can use the InternetFindNextFile function to retrieve subsequent Gopher objects.

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.