CInternetSession::SetOption

Call this member function to set options for the Internet session.

BOOL SetOption( 
   DWORD dwOption, 
   LPVOID lpBuffer, 
   DWORD dwBufferLength, 
   DWORD dwFlags = 0  
); 
BOOL SetOption( 
   DWORD dwOption, 
   DWORD dwValue, 
   DWORD dwFlags = 0  
);

Parameters

  • dwOption
    The Internet option to set. See Option Flags in the Windows SDK* *for a list of the possible options.

  • lpBuffer
    A buffer that contains the option setting.

  • dwBufferLength
    The length of lpBuffer or the size of dwValue.

  • dwValue
    A DWORD that contains the option setting.

  • dwFlags
    Indicates various caching options. The default is set to 0. The possible values include:

    • INTERNET_FLAG_DONT_CACHE   Do not cache the data, either locally or in any gateway servers.

    • INTERNET_FLAG_OFFLINE   Download operations are satisfied through the persistent cache only. If the item does not exist in the cache, an appropriate error code is returned. This flag may be combined with the bitwise OR (|) operator.

Return Value

If the operation was successful, a value of TRUE is returned. If an error occurred, a value of FALSE is returned. If the call fails, the Win32 function GetLastError may be called to determine the cause of the error.

Requirements

Header: afxinet.h

See Also

Reference

CInternetSession Class

Hierarchy Chart

Other Resources

CInternetSession::ServiceTypeFromHandle