Global Navigation Bar

MapInfo Products Knowledge Base


Product: MapBasic
Version: 6.x
Platform: Not Platform Related
Category: Documentation

Summary:
Systeminfo - Description

Question:
Systeminfo - Description

Answer:
Systeminfo

Purpose

Return the MapInfo application OLE Automation IDispatch pointer. This enables developers to control a MapInfo Automation object from within the same process space as an executing instance of MapInfo Professional (e.g. from a dll invoked by a MapBasic application) and guarantee that the object instance they are manipulating is not some other instance of MapInfo running in a separate process space.

Syntax

SystemInfo( attribute )
attribute is an Integer code indicating which system attribute to query.

Return Value

SmallInt, Logical, or String

Description

The SystemInfo( ) function returns information about MapInfo's system status. The attribute can be any of the codes listed in the table below. The codes are defined in MAPBASIC.DEF.

attribute code SystemInfo( ) Return Value

SYS_INFO_APPLICATIONWND Integer, representing the Windows HWND specified by the Set Application Window statement (or zero if no such HWND has been set).

SYS_INFO_APPIDISPATCH (value=17) Integer, representing the IDispatch OLE Automation pointer for the MapInfo Application.

SYS_INFO_APPVERSION Integer value: the version number with which the application was compiled, multiplied by 100.
SYS_INFO_CHARSET String value: the name of the native character set.
SYS_INFO_COPYPROTECTED Logical value: TRUE means the user is running a copy-protected version of MapInfo.
SYS_INFO_DATE_FORMAT String: "US" or "Local" depending on the date formatting in effect; for details, see Set Format.
SYS_INFO_DDESTATUS Integer value, representing the number of elements in the DDE execute queue. If the queue is empty, SystemInfo( ) returns zero (if an incoming execute would be enqueued) or -1 (if an execute would be executed immediately).

SYS_INFO_DIG_INSTALLED Logical value: TRUE if a digitizer is installed, along with a compatible driver.
SYS_INFO_DIG_MODE Logical value: TRUE if Digitizer Mode is on.
SYS_INFO_MAPINFOWND Integer, representing a Windows HWND of the MapInfo frame window, or zero on non-Windows platforms.
SYS_INFO_MDICLIENTWND Integer, representing a Windows HWND of the MapInfo MDICLIENT window, or 0 on non-Windows platforms.
SYS_INFO_MIPLATFORM Integer value, indicating the type of MapInfo software that is running. The return value will be one of these:
MIPLATFORM_WIN16 (16-bit Windows)
MIPLATFORM_WIN32 (32-bit Windows)
MIPLATFORM_MAC68K (680x0 Macintosh)
MIPLATFORM_POWERMAC (Power Macintosh)
MIPLATFORM_HP (HP UNIX workstation)
MIPLATFORM_SUN (Sun UNIX workstation)

SYS_INFO_MIVERSION Integer value, indicating the version of MapInfo that is currently running, multiplied by 100.
SYS_INFO_NUMBER_FORMAT String: "9,999.9" or "Local" depending on the number formatting in effect; for details, see Set Format.
SYS_INFO_PLATFORM Integer value, indicating the hardware platform on which the application is running. The return value will be one of these: PLATFORM_WIN, PLATFORM_MAC, or PLATFORM_MOTIF.
SYS_INFO_PRODUCTLEVEL Integer value, indicating the product level of the version of MapInfo that is running (e.g. 200 for MapInfo Professional).

SYS_INFO_RUNTIME Logical value: TRUE if invoked within a run-time version of MapInfo, FALSE otherwise.

The MapInfo application OLE Automation IDispatch pointer enables developers to control a MapInfo Automation object from within the same process space as an executing instance of MapInfo Professional (e.g. from a dll invoked by a MapBasic application) and guarantee that the object instance they are manipulating is not some other instance of MapInfo running in a separate process space.

Error Conditions

ERR_FCN_ARG_RANGE error generated if an argument is outside of the valid range

Example

The following example uses the SystemInfo( ) function to determine what type of MapInfo software is running. The program only calls a DDE-related procedure if the program is running some version of MapInfo for Windows.

Declare Sub DDE_Setup

If SystemInfo(SYS_INFO_PLATFORM) = PLATFORM_WIN Then
Call DDE_Setup
End If

Warning

The return value from this function, when invoked with SYS_INFO_APPIDISPATCH, is an unmarshalled pointer to an instance of MapInfo's OLE Automation IDispatch interface. As such, it must only be used as an IDispatch pointer from within the same process space as the executing MapInfo executable. It is intended to be used to invoke MapInfo Automation methods from a DLL called by an executing MapBasic application. It is not appropriate to use it from Visual Basic, Delphi or standalone C/C++ applications (which already have an appropriate IDispatch pointer as their connection to MapInfo Professional)

Last Modified: 06/27/2001 09:14:37 AM
Global Navigation Bar