BOOL QueryInfo( DWORD dwInfoLevel, LPVOID lpvBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex = NULL ) const;
BOOL QueryInfo( DWORD dwInfoLevel, CString& str, LPDWORD dwIndex = NULL ) const;
BOOL QueryInfo( DWORD dwInfoLevel, SYSTEMTIME* pSysTime, LPDWORD dwIndex = NULL ) const;
Return Value
Nonzero if successful; otherwise 0. If the call fails, the Win32 function GetLastError may be called to determine the cause of the error.
Parameters
dwInfoLevel
A combination of the attribute to query and the following flags that specify the type of information requested:
See the Remarks section for a list of the possible values.
lpvBuffer
A pointer to the buffer that receives the information.
lpdwBufferLength
On entry, this points to a value containing the length of the data buffer, in number of characters or bytes. See the Remarks section for more detailed information about this parameter.
lpdwIndex
A pointer to a zero-based header index. Can be NULL. Use this flag to enumerate multiple headers with the same name. On input, lpdwIndex indicates the index of the specified header to return. On output, lpdwIndex indicates the index of the next header. If the next index cannot be found, ERROR_HTTP_HEADER_NOT_FOUND is returned.
str
A reference to the CString object receiving the returned information.
dwIndex
An index value. See lpdwIndex.
pSysTime
A pointer to a Win32 SYSTEMTIME structure.
Remarks
Call this member function to return response or request headers from an HTTP request. Use this member function only after a successful call to SendRequest or on a CHttpFile object successfully created by OpenURL.
You can retrieve the following types of data from QueryInfo:
When a string is written to the buffer, and the member function succeeds, lpdwBufferLength contains the length of the string in characters minus 1 for the terminating NULL character.
The possible dwInfoLevel values include:
CHttpFile Overview | Class Members | Hierarchy Chart
See Also CInternetFile, CHttpConnection::OpenRequest, CFtpConnection, CGopherConnection, CInternetConnection