Classes | Variables
SetProfile: Set current car profile

Classes

struct  RI_CSetProfile
 Data structure for the Request "SetProfile". More...
 

Variables

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

Detailed Description

Variable Documentation

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

Message ID for the Request "RiSetProfile":
RI_MESSAGE_SETPROFILE

Write Memory:

RI_SetProfile_WriteData(LPARAM id, RI_CSetProfile data);

Return Values for SetProfile:

RI_NOERROR = change Profile success
RI_NOTADDED = Profile cannot change

Description:

Activates a vehicle-profile (profile has to exist in the LKWProfile-directory).

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_SetProfile::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
if ( message == RI_MESSAGE_SETPROFILE )
{
if ( (LRESULT)wParam == RI_NOERROR)
//change Profile success. errorcode (0)
else if ( (LRESULT)wParam == RI_NODESC)
//Profile cannot change. errorcode (12)
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_SetProfile::foo()
{
//define struct
//copy data
wcscpy(data.m_ProfileName, L"PKW");
//write data in shared memory
LPARAM id = GetUniqueID();
LRESULT sharing_ret = RI_SetProfile_WriteData( id, data );
if ( sharing_ret != RI_NOERROR )
return;
if ( RI_MESSAGE( RI_MESSAGE_SETPROFILE, 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