Classes | Functions | Variables
VisibleMapRect: Set map rect

Classes

struct  RI_CVisibleMapRect
 Data structure for the Request "VisibleMapRect". More...
 

Functions

LRESULT RI_VisibleMapRect_WriteData (LPARAM, RI_CVisibleMapRect &)
 Write data to shared memory for "VisibleMapRect".
 

Variables

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

Detailed Description

Variable Documentation

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

Message ID for the Request "VisibleMapRect":
RI_MESSAGE_VISIBLEMAPRECT

Write Memory:

RI_VisibleMapRect_WriteData(LPARAM id, RI_CVisibleMapRect data );

Return Values for VisibleMapRect:

RI_NOERROR = change MapRect success
RI_NODESC = AutoPanning is deactivated.

Description:

Sets the visible map section to the given rect if m_panning is true. There is no automatic switch back to the current gps position on the map, so be sure to call this message again with m_panning = false to center the map to the current position !
Possible coordinate formats are mercator and geodecimal (see also the data-struct description).

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_VisibleMapRect::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
if ( message == RI_MESSAGE_VISIBLEMAPRECT )
{
if ( (LRESULT)wParam == RI_NOERROR )
//change MapRect success. errorcode (0)
else if ( (LRESULT)wParam == RI_NODESC )
//AutoPanning 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_VisibleMapRect::foo()
{
// *** define struct ***
// *** copy data ***
data.m_panning = true;
// set the input format to mercator
data.m_flag = true;
wcscpy(data.m_map_bottom, L"937170");
wcscpy(data.m_map_left, L"6270165");
wcscpy(data.m_map_right, L"6270165");
wcscpy(data.m_map_top, L"937170");
//write data to shared memory
LPARAM id = GetUniqueID();
LRESULT sharing_ret = RI_VisibleMapRect_WriteData( id, data );
if ( sharing_ret != RI_NOERROR )
return;
if ( RI_MESSAGE( RI_MESSAGE_VISIBLEMAPRECT, 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