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

Remote Interface Documentation

Variables

RollBackToMainMenu: Roll back the dialog to the main menu

Variables

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

Variable Documentation

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

Message ID for the Request "roll back to main menu":
RI_MESSAGE_ROLLBACKTOMAINMENU

Write Memory:

This function has no writer.

Read Memory:

This function has no reader.

Return Values for RollBackToMainMenu:

RI_NOERROR = Roll Back to Main Menu succeeded.
RI_NODESC = Roll Back to Main Menu not succeeded.

Description:

Rolls back the navigator to the main menu. Can be used to cancel a navigation or a simulation.

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_RollBackToMainMenu::WindowProc ( UINT  message , WPARAM  wParam , LPARAM  lParam )
{
    //check messages for answer from RI
    if ( message == RI_MESSAGE_ROLLBACKTOMAINMENU )
    {
        if ( (LRESULT)wParam == RI_NOERROR )
            //Roll Back to Main Menu succeeded. errorcode (0)
        else if ( (LRESULT)wParam == RI_NODESC)
            //Roll Back to Main Menu not succeeded (error 12)
        else 
            //Roll Back to Main Menu not succeeded. errorcode (-1)
    }
    return CDialog::WindowProc( message, wParam, lParam );
}

void CDlgMFC_RollBackToMainMenu::foo()
{
    LPARAM id = GetUniqueID();
    //send the message to RI
    if ( RI_MESSAGE( RI_MESSAGE_ROLLBACKTOMAINMENU, 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