Variables
Search6DigitPostcode: search for a 6digit postcode in NL

Variables

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

Detailed Description

Variable Documentation

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

Message ID for the Request "search 6digit postcode":
RI_MESSAGE_SEARCH6DIGITPOSTCODE

Write Memory:

RI_Search6DigitPostcode_WriteData(LPARAM id, RI_CSearch6DigitPostcode data );

Read Memory:

RI_Search6DigitPostcode_ReadData(LPARAM id, RI_CSearch6DigitPostcode data );

Return Values for Search6DigitPostcode:

RI_NOERROR = Search succeeded
RI_AMBIGUOUS = Search not precise
RI_NOTFOUND = No address found
RI_NOTAV = 6 digit data file missing

Description:

Returns one result with the name of the street and the coordinate of the given 6 digit postcode.
If the postcode string is less than 6 digits, the first of the found results will be returned and the error code will be set to RI_AMBIGUOUS.
The housenumber will be used to get the best result by checking against the housenumber ranges of the postcode.
Results with housenumbers out of the range will be discarded.
If there are more than one result with the same postcode, then the one that matches the even or odd (dependent on the housenumber)
housenumber range will be returned. If that also doesn't give a single result, the first result will be returned and the error code will be set to RI_AMBIGUOUS.
If no PLZ6-Layer is available, RI_NOTAV will be returned.

Returns a single package.

<H2>Example:</H2>
#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_Search6DigitPostcode::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
{
if ( (LRESULT)wParam == RI_NOERROR )
{
//Searc succeeded. errorcode (0)
//get the data from the shared memory
LRESULT read_suc = RI_Search6DigitPostcode_ReadData( lParam, data );
if ( read_suc != RI_NOERROR )
//...data was overwritten. errorcode (-2)<BR>
else
{
TRACE(TEXT("X-Koordinate: %i\n"), data.m_mercator_x);
TRACE(TEXT("Y-Koordinate: %i\n"), data.m_mercator_y);
TRACE(TEXT("Result name: %s\n"), data.m_Streetname);
}
}
else if ( (LRESULT)wParam == RI_AMBIGUOUS )
{
//Searc succeeded, but found street was ambiguous.
//get the data from the shared memory
LRESULT read_suc = RI_Search6DigitPostcode_ReadData( lParam, data );
if ( read_suc != RI_NOERROR )
//...data was overwritten. errorcode (-2)<BR>
else
{
TRACE(TEXT("X-Koordinate: %i\n"), data.m_mercator_x);
TRACE(TEXT("Y-Koordinate: %i\n"), data.m_mercator_y);
TRACE(TEXT("Result name: %s\n"), data.m_Streetname);
}
}
else
//Search6DigitPostcode not succeeded. errorcode (-1)
}
return CDialog::WindowProc( message, wParam, lParam );
}
void CDlgMFC_Search6DigitPostcode::foo()
{
//*** copy data ***
wcscpy(data.m_Postcode, L"1441BJ");
data.m_Housenumber = 3;
//*** write data in shared memory ***
LPARAM id = GetUniqueID();
LRESULT sharing_ret = RI_Search6DigitPostcode_WriteData( id, data );
if ( sharing_ret != RI_NOERROR )
return;
if ( RI_MESSAGE( RI_MESSAGE_SEARCH6DIGITPOSTCODE, GetSafeHwnd(), id ) == RI_NOERROR )
//message sending succeeded
else
//navigation software not running
}

© PTV Group 2020 Generated on Wed Apr 15 2020 12:47:53 for by doxygen 1.8.8