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

Remote Interface Documentation

Classes | Functions | Variables

AddStopOffPoint2PreviousDestinationList: Add a stop off point to the previous destinationlist

Classes

struct  RI_CAddStopOffPoint2PreviousDestinationList
 Data structure for the Request "AddStopOffPoint2PreviousDestinationList". More...

Functions

LRESULT RI_AddStopOffPoint2PreviousDestinationList_WriteData (LPARAM, RI_CAddStopOffPoint2PreviousDestinationList &)
 Write data to shared memory for "Add Stop Off Point 2 Previous DestinationList".

Variables

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

Variable Documentation

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

Message ID for the Request "add stop off ponit to previous destination list":
RI_MESSAGE_ADDSTOPOFFPOINT2PDL

Write Memory:

RI_AddStopOffPoint2PreviousDestinationList_WriteData(LPARAM id, RI_CAddStopOffPoint2PreviousDestinationList data );

Return Values for AddStopOffPoint2PreviousDestinationList:

RI_NOERROR = Add Stop of Point to previous destination list succeeded
RI_NODESC = Add Stop of Point to previous destination list not succeeded, because description failed
RI_NOTADDED = Add Stop of Point to previous destination list not succeeded, because AddStation failed

Description:

Adds a stop-off-point to the previous destination list.

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_AddStopOffPoint2PreviousDestinationList::WindowProc ( UINT  message , WPARAM  wParam , LPARAM  lParam )
{
    //check messages for answer from RI
    if ( message == RI_MESSAGE_ADDSTOPOFFPOINT2PDL )
    {
        if ( (LRESULT)wParam == RI_NOERROR )
            //Add Stop of Point to PreviousDestination List succeeded. errorcode (0)
        else if ( (LRESULT)wParam == RI_NOTADDED )
        {
            //Add Stop of Point to PreviousDestination List not succeeded, because AddStation failed. errorcode (11)
        }
        else if ( (LRESULT)wParam == RI_NODESC )
        {
            //Add Stop of Point to PreviousDestination List not succeeded, because description failed. errorcode (12)
        }
    }
    return CDialog::WindowProc( message, wParam, lParam );
}

void CDlgMFC_AddStopOffPoint2PreviousDestinationList::foo()
{
    //*** copy data ***
    RI_CAddStopOffPoint2PreviousDestinationList data;
    data.m_mercator_x = 937170;
    data.m_mercator_y = 6270165;
    wcscpy(data.m_Caption, L"PTV AG Karlsruhe");
    wcscpy(data.m_Description, L"PTV AG Karlsruhe");

    //*** write data in shared memory ***
    LPARAM id = GetUniqueID();
    LRESULT sharing_ret = RI_AddStopOffPoint2PreviousDestinationList_WriteData( id, data );
    if ( sharing_ret != RI_NOERROR )
        return;
    if ( RI_MESSAGE( RI_MESSAGE_ADDSTOPOFFPOINT2PDL, 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