Home · All Commands · First Steps · Tutorials · Demos · FAQ | ||
Remote Interface Documentation |
Classes | |
struct | RI_CClearStopOffPoint |
Data structure for the Request "ClearStopOffPoint". More... | |
Functions | |
LRESULT | RI_ClearStopOffPoint_ReadData (LPARAM, RI_CClearStopOffPoint &) |
Read data from shared memory for "Clear Stop Off Point". | |
LRESULT | RI_ClearStopOffPoint_WriteData (LPARAM, RI_CClearStopOffPoint &) |
Write data to shared memory for "Clear Stop Off Point". | |
Variables | |
const UINT | RI_MESSAGE_DELSTOPOFFPOINTFROMLIST = RegisterWindowMessage(TEXT("RI_MESSAGE_DELSTOPOFFPOINTFROMLIST")) |
const UINT RI_MESSAGE_DELSTOPOFFPOINTFROMLIST = RegisterWindowMessage(TEXT("RI_MESSAGE_DELSTOPOFFPOINTFROMLIST")) |
Message ID for the Request "delete stop off point from stationlist":
RI_MESSAGE_DELSTOPOFFPOINTFROMLIST
RI_ClearStopOffPoint_WriteData(LPARAM id, RI_CClearStopOffPoint data );
RI_ClearStopOffPoint_ReadData(LPARAM id, RI_CClearStopOffPoint data );
RI_NOERROR = The stop off point was successfully deleted
RI_NOTFOUND = Stop off Point was not found
Deletes a station from the stationlist.
#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() ) ) return RI_NAVIGATIONNOTACTIVE; //send the request PostMessage( RI_GetTNS(), request, WPARAM(h_client), id ); return RI_NOERROR; } LRESULT CDlgMFC_ClearStopOffPoint::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam ) { //check messages for answer from RI if ( message == RI_MESSAGE_DELSTOPOFFPOINTFROMLIST ) { if ( (LRESULT)wParam == RI_NOERROR ) { RI_CClearStopOffPoint data; LRESULT read_suc = RI_ClearStopOffPoint_ReadData( lParam, data ); TRACE( TEXT("The stop off point with the unique ID %i"),data.m_StationID ); TRACE( TEXT("was successfully deleted. errorcode (0)\r\n") ); } else //Stop off Point was not removed. errorcode (-1) } return CDialog::WindowProc( message, wParam, lParam ); } void CDlgMFC_ClearStopOffPoint::foo() { //*** copy data *** RI_CClearStopOffPoint data; //write UniqueId from Stop off Point data.m_StationID = 47; //*** write data in shared memory *** LPARAM id = GetUniqueID(); LRESULT sharing_ret = RI_ClearStopOffPoint_WriteData( id, data ); if ( sharing_ret != RI_NOERROR ) return; if ( RI_MESSAGE( RI_MESSAGE_DELSTOPOFFPOINTFROMLIST, GetSafeHwnd(), id ) == RI_NOERROR ) //message sending succeeded else //navigation software not running }
© PTV AG 2011 | Generated on Fri Oct 14 2011 10:17:32 for RI by 1.7.1 |