MICreateSessionFull() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Creates a CInternetSession object and returns the handle to it.

Syntax

MICreateSessionFull( ByVal strAgent As String, ByVal dwContext As Integer, 
	ByVal dwAccessType As Integer, ByVal strProxyName As String, 
	ByVal strProxyBypass As String, ByVal dwFlags As Integer 
	As CInternetSession

strAgent is a string that identifies the name of the application or entity calling the Internet functions (for example, "MapInfo Pro"). If the string is empty, the application name is used.

dwContext is the context identifier for the operation.

dwAccessType is The type of access required. The following are the valid values, exactly one of which may be supplied:

dwAccessType value Definition
INTERNET_OPEN_TYPE_PRECONFIG Connect using preconfigured settings in the registry. This access type is set as default. To connect through a TIS proxy, set dwAccessType to this value; you then set the registry appropriately.
INTERNET_OPEN_TYPE_DIRECT Connect directly to Internet.
INTERNET_OPEN_TYPE_PROXY Connect through a CERN proxy.

strProxyName is the name of the preferred CERN proxy if dwAccessType is set as INTERNET_OPEN_TYPE_PROXY. Default is an empty string.

strProxyBypass is a string that contains an option list of server addresses. These addresses may be bypassed when using proxy access. If an empty string is supplied, the bypass list will be read from the registry. This parameter is meaningful only if dwAccessType is set to INTERNET_OPEN_TYPE_PROXY.

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

dwFlag value Definition
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.

Return Value

A handle to a CInternetSession object. If the call fails, Null is returned. To determine the cause of the failure, call the MIGetErrorMessage() function.

Description

MICreateSessionFull() is the first Internet function called by an application. Use CInternetSession to create and initialize a single or several simultaneous Internet sessions and, if necessary, to describe your connection to a proxy server. If you want to perform service-specific (for example, HTTP, FTP) actions on files located on a server, you must establish the appropriate connection with that server. To open a particular kind of connection directly to a particular service, use the proper functions, such as the MIGetHttpConnection() function or the MIGetFtpConnection() function. For detailed information, refer to the Microsoft MSDN library.

The caller has to dispose of the handle by calling the MICloseSession() procedure when the handle is no longer in use.