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

Remote Interface Documentation

Classes | Functions | Variables

RIDump: Dump RI-commands to a file

Classes

struct  RI_CRiDump
 Data structure for the Request "RiDump". More...

Functions

LRESULT RI_RiDump_ReadData (LPARAM, RI_CRiDump &)
 Read data from shared memory for "RiDump".
LRESULT RI_RiDump_WriteData (LPARAM, RI_CRiDump &)
 Write data to shared memory for "RiDump".

Variables

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

Variable Documentation

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

Message ID for the Request "RiDump":
RI_MESSAGE_RIDUMP

Write Memory:

RI_RiDump_WriteData(LPARAM id, RI_CRiDump data);

Read Memory:

RI_RiDump_ReadData(LPARAM id, RI_CRiDump data);

Return Values for RiDump:

RI_NOERROR = Dump is activated
RI_NODESC = Dump is deactivated

Description:

Dumps all RI-Interface transfer to a file in the remote directory.

Returns a single package

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_RiDump::WindowProc ( UINT  message , WPARAM  wParam , LPARAM  lParam )
{
    //check messages for answer from RI
    if ( message == RI_MESSAGE_RIDUMP )
    {
        if ( (LRESULT)wParam == RI_NOERROR)
            //Dump is activated. errorcode (0)
        else if ( (LRESULT)wParam == RI_NODESC)
            //Dump is deactivated. errorcode (12)
        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_RiDump::foo()
{
    //define struct
    RI_CRiDump data;
    //copy data
    data.m_dump = true;
    //write data in shared memory
    LPARAM id = GetUniqueID();
    LRESULT sharing_ret = RI_RiDump_WriteData( id, data );
    if ( sharing_ret != RI_NOERROR ) 
        return;
    if ( RI_MESSAGE( RI_MESSAGE_RIDUMP, 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 doxygen 1.7.1