Classes | Functions | Variables
GetPreviousDestinationList: Get all stop off points from the previous destinationlist

Classes

struct  RI_CGetPreviousDestinationList
 Data structure for the Request "GetPreviousDestinationList". More...
 

Functions

LRESULT RI_GetPreviousDestinationList_ReadData (LPARAM, RI_CGetPreviousDestinationList &)
 Read data from shared memory for "Get stop off point from Previous DestinationList".
 
LRESULT RI_GetPreviousDestinationList_WriteData (LPARAM, RI_CGetPreviousDestinationList &)
 Write data to shared memory for "Get stop off point from Previous DestinationList".
 

Variables

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

Detailed Description

Variable Documentation

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

Message ID for the Request "Get stop off point from Previous DestinationList":
RI_MESSAGE_GETDESTINATIONLIST

Write Memory:

RI_GetPreviousDestinationList_WriteData(LPARAM id, RI_CGetPreviousDestinationList data );

Read Memory:

RI_GetPreviousDestinationList_ReadData(LPARAM id, RI_CGetPreviousDestinationList data );

Return Values for GetPreviousDestinationList:

RI_NOERROR = The stop off point was successfully deleted

Description:

Gets the previous destination list. If more than one station is in the list, the first received data structure will include the number of stations. The user will have explicitly send a new message to get the next station until all stations are transfered.

Can return multiple packages

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_GetPreviousDestinationList::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
{
if ( (LRESULT)wParam == RI_NOERROR )
{
LRESULT read_suc = RI_GetPreviousDestinationList_ReadData( lParam, data );
if ( read_suc != RI_NOERROR )
//...data was overwritten. errorcode (-2)
else
{
//examine whether station is smaller than more stationscounter
if (data.m_index < data.m_listcount )
{
TRACE(TEXT("Caption: %s"),data.m_Caption);
TRACE(TEXT("Description: %s"),data.m_Description);
TRACE(TEXT("X-Koordinate: %i"),data.m_mercator_x);
TRACE(TEXT("Y-Koordinate: %i"),data.m_mercator_y);
TRACE(TEXT("ID: %i"),data.m_StationID);
//advance station counter
data.m_index = data.m_index + 1;
//write data
LRESULT sharing_ret = RI_GetPreviousDestinationList_WriteData( data.m_ID, data );
//get next station from the list
RI_MESSAGE( RI_MESSAGE_GETDESTINATIONLIST, GetSafeHwnd(), data.m_ID );
}
}
}
else
//Get Stop of Point List not succeeded. errorcode (-1)
return CDialog::WindowProc( message, wParam, lParam );
}
void CDlgMFC_GetPreviousDestinationList::foo()
{
//*** copy data ***
//write flag and index
data.m_index = 0;
//*** write data in shared memory ***
LPARAM id = GetUniqueID();
LRESULT sharing_ret = RI_GetPreviousDestinationList_WriteData( id, data );
if ( sharing_ret != RI_NOERROR )
return;
if ( RI_MESSAGE( RI_MESSAGE_GETDESTINATIONLIST, 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