Classes | Functions | Variables
ChangeApplicationOptions: Change the application options

Classes

struct  RI_CChangeApplicationOptions
 Data structure for the Request "ChangeApplicationOptions". More...
 

Functions

LRESULT RI_ChangeApplicationOptions_WriteData (LPARAM, RI_CChangeApplicationOptions &)
 Write data to shared memory for "Change Application Options".
 

Variables

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

Detailed Description

Variable Documentation

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

Message ID for the Request "ChangeApplicationOptions":
RI_MESSAGE_CHANGEOPTIONS

Write Memory:

RI_ChangeApplicationOptions_WriteData(LPARAM id, RI_CChangeApplicationOptions data );

Return Values for ChangeApplicationOptions:

RI_NOERROR = Change application options succeeded

Description:

Set application options like using ferries or motorways, volume, avoid u-turns and so on (see data structure for more details).

Example:

#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_ChangeApplicationOptions::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
if ( message == RI_MESSAGE_CHANGEOPTIONS )
{
if ( (LRESULT)wParam == RI_NOERROR )
//Change application options succeeded. errorcode(0)
else
//Change application options not succeeded. errorcode(-1)
}
return CDialog::WindowProc( message, wParam, lParam );
}
void CDlgMFC_ChangeApplicationOptions::foo()
{
//define struct
// *** copy data ***
data.m_ShowCompass = 1;
data.m_ShowScale = 1;
data.m_MapFacingNorth = 0;
data.m_InfoLeftSide = 0;
data.m_InfoRightSide = 0;
data.m_Volume = 80;
data.m_AvoidUTurns = 1;
data.m_MapInItinerary = 0;
data.m_Vehicle = 6;
data.m_Optimisation = 2;
data.m_Motorway = 1;
data.m_Ferries = 1;
// *** write data in shared memory ***
LPARAM id = GetUniqueID();
LRESULT sharing_ret = RI_ChangeApplicationOptions_WriteData( id, data );
if ( sharing_ret != RI_NOERROR )
return;
if ( RI_MESSAGE( RI_MESSAGE_CHANGEOPTIONS, 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