Home · All Commands · First Steps · Tutorials · Demos · FAQ | ||
Remote Interface Documentation |
Variables | |
const UINT | RI_MESSAGE_DATAUPDATE = RegisterWindowMessage(TEXT("RI_MESSAGE_DATAUPDATE")) |
const UINT RI_MESSAGE_DATAUPDATE = RegisterWindowMessage(TEXT("RI_MESSAGE_DATAUPDATE")) |
Message ID for the Request "DataUpdate":
RI_MESSAGE_DATAUPDATE
This function has no writer.
This function has no reader.
RI_NOERROR = Route recalculation succeeded
RI_NOTRUN = Route recalculation does not succeed because the route calculation is running
Recalculates the route if application is in navigation mode.
#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_DataUpdate::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam ) { //check messages for answer from RI if ( message == RI_MESSAGE_DATAUPDATE ) { if ( (LRESULT)wParam == RI_NOERROR ) //Route recalculation succeeded. errorcode (0) else if ( (LRESULT)wParam == RI_NOTRUN ) { //Route recalculation didn't succeed, because the route calculation is running. errorcode (17) //please try again... LPARAM id = GetUniqueID(); RI_MESSAGE( RI_MESSAGE_DATAUPDATE, GetSafeHwnd(), id ); } 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_DataUpdate::foo() { LPARAM id = GetUniqueID(); if ( RI_MESSAGE( RI_MESSAGE_DATAUPDATE, GetSafeHwnd(), id ) == RI_NOERROR ) //message sending succeeded else //navigation software not running }
© PTV AG 2011 | Generated on Fri Oct 14 2011 10:17:33 for RI by 1.7.1 |