Classes | Variables
GetProfile: Get current car profile

Classes

struct  RI_CGetProfile
 Data structure for the Request "GetProfile". More...
 

Variables

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

Detailed Description

Variable Documentation

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

Message ID for the Request "GetProfile":
RI_MESSAGE_GETPROFILE

    <H3>Read Memory:</H3>
    RI_GetProfile_ReadData(LPARAM id, RI_CGetProfile data);
    <BR>
    <H3>Return Values for GetProfile:</H3>
    RI_NOERROR = GetProfile succeeded<BR><BR>

    <h2>Description:</h2>Get the current used vehicle-profile name.
<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_GetProfile::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
if ( message == RI_MESSAGE_GETPROFILE )
{
if ( (LRESULT)wParam == RI_NOERROR)
{
//get Profile success. errorcode (0)
//read from shared memory
LRESULT read_suc = RI_GetProfile_ReadData( lParam, data );
if ( read_suc != RI_NOERROR )
//...data was overwritten.
else
TRACE(TEXT("VehicleProfile: %s\r\n"),data.m_ProfileName);
}
else if ( (LRESULT)wParam == RI_NAVIGATIONNOTACTIVE)
//Navigator is not running or the configuration is not complete. errorcode(3)
}
return CDialog::WindowProc( message, wParam, lParam );
}
void CDlgMFC_GetProfile::foo()
{
LPARAM id = GetUniqueID();
if ( RI_MESSAGE( RI_MESSAGE_GETPROFILE, 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