Classes | Functions | Variables
AddStopOffPoint: Add a stop off point to the stationlist

Classes

struct  RI_CAddStopOffPoint
 Data structure for the Request "AddStopOffPoint". More...
 

Functions

LRESULT RI_AddStopOffPoint_WriteData (LPARAM, RI_CAddStopOffPoint &)
 Write data to shared memory for "Add Stop Off Point".
 

Variables

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

Detailed Description

Variable Documentation

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

Message ID for the Request "add stop off ponit":
RI_MESSAGE_ADDSTOPPOFFPOINT

Write Memory:

RI_AddStopOffPoint_WriteData(LPARAM id, RI_CAddStopOffPoint data );

Return Values for AddStopOffPoint:

RI_NOERROR = AddStopOffPoint succeeded
RI_NODESC = AddStopOffPoint not succeeded, Description failed
RI_NOTADDED = AddStopOffPoint not succeeded, AddStation failed
RI_NOTLINKABLE = AddStopOffPoint not succeeded, Position not linkableNo Address found

Description:

Adds a stop-off-point to the stationlist.

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_AddStopOffPoint::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
if ( message == RI_MESSAGE_ADDSTOPPOFFPOINT )
{
if ( (LRESULT)wParam == RI_NOERROR )
//AddStopOffPoint returned. errorcode (0)
else if ( (LRESULT)wParam == RI_NODESC )
//AddStopOffPoint not returned, Description failed. errorcode (12)
else if ( (LRESULT)wParam == RI_NOTLINKABLE )
//AddStopOffPoint not returned, Position not linkable. errorcode (10)
else if ( (LRESULT)wParam == RI_NOTADDED )
//AddStopOffPoint not returned, AddStation failed. errorcode (11)
}
return CDialog::WindowProc( message, wParam, lParam );
}
void CDlgMFC_AddStopOffPoint::foo()
{
//*** copy data ***
data.m_mercator_x = 1019870;
data.m_mercator_y = 6228555;
wcscpy(data.m_Caption, L"Stuttgart");
wcscpy(data.m_Description, L"Stuttgart");
//*** write data in shared memory ***
LPARAM id = GetUniqueID();
LRESULT sharing_ret = RI_AddStopOffPoint_WriteData( id, data );
if ( sharing_ret != RI_NOERROR )
return;
if ( RI_MESSAGE( RI_MESSAGE_ADDSTOPPOFFPOINT, 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