Home · All Commands · First Steps · Tutorials · Demos · FAQ
 

Remote Interface Documentation

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"))

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() ) ) 
        return RI_NAVIGATIONNOTACTIVE;
    //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 ***
    RI_CAddStopOffPoint 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 AG 2011 Generated on Fri Oct 14 2011 10:17:32 for RI by doxygen 1.7.1