Classes | Functions | Variables
SystemInfo: Get information from the system

Classes

struct  RI_CSystemInfo
 Data structure for the Request "SystemInfo". More...
 

Functions

LRESULT RI_SystemInfo_ReadData (LPARAM, RI_CSystemInfo &)
 Read data from shared memory for "System information".
 

Variables

const UINT RI_MESSAGE_SYSTEMINFO = RegisterWindowMessage(TEXT("RI_MESSAGE_SYSTEMINFO"))
 

Detailed Description

Variable Documentation

const UINT RI_MESSAGE_SYSTEMINFO = RegisterWindowMessage(TEXT("RI_MESSAGE_SYSTEMINFO"))

Message ID for the Request "system information":
RI_MESSAGE_SYSTEMINFO

    <H3>Read Memory:</H3>
    RI_SystemInfo_ReadData(LPARAM id, RI_CSystemInfo data );
    <BR>
    <H3>Return Values for SystemInfo:</H3>
    RI_NOERROR = System info succeeded<BR><BR>

    <h2>Description:</h2>Returns system information like the current language, available languages,
    the current map, available maps and so on (see data structure for more details).
<h3>Returns a single package</h3>
    <H2>Example:</H2>
#define USE_LOADLIBRARY
#include "TNSRemoteInterfaceDll.h"
LPARAM GetUniqueID()
{
//generate unique ID
static LPARAM id = 0;
if (++id == 0) ++id; // do not use 0 !!!!!
return id;
}
inline LRESULT RI_MESSAGE( const UINT request, HWND h_client, LPARAM id )
{
//check if RI handle is valid
if ( !IsWindow( RI_GetTNS() ) )
//send the request
PostMessage( RI_GetTNS(), request, WPARAM(h_client), id );
return RI_NOERROR;
}
LRESULT CDlgMFC_SystemInfo::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
if ( message == RI_MESSAGE_SYSTEMINFO )
{
if ( (LRESULT)wParam == RI_NOERROR )
{
//read data from Shared Memory
LRESULT read_suc = RI_SystemInfo_ReadData( lParam, data );
//System info succeeded. errorcode (0)
TRACE( TEXT("Programm Version: %s"),data.m_Version );
TRACE( TEXT("Programm Build: %s"),data.m_Build );
TRACE( TEXT("Current Map Name: %s"),data.m_CurrentMapName);
TRACE( TEXT("Current Map Date: %s"),data.m_CurrentMapDate );
TRACE( TEXT("Current Map Version: %s"),data.m_CurrentMapVersion );
for (int i=0; i<data.m_MapCount; i++)
{
TRACE(TEXT("Available Maps: %"s),data.m_AvailableMaps[i]);
}
TRACE( TEXT("Current Language: %s"),data.m_CurrentLanguage );
TRACE( TEXT("Available Language: %s"),data.m_AvailableLanguages );
}
else
//System info not succeeded. errorcode (-1)
}
return CDialog::WindowProc( message, wParam, lParam );
}
void CDlgMFC_SystemInfo::foo()
{
LPARAM id = GetUniqueID();
if ( RI_MESSAGE( RI_MESSAGE_SYSTEMINFO, GetSafeHwnd(), id ) == RI_NOERROR )
//message sending succeeded
else
//navigation software not running
}

© PTV Group 2020 Generated on Wed Apr 15 2020 12:47:52 for by doxygen 1.8.8