Automating MapPoint in C++ With Built In GPS Features Enabled

Eric Frost
08-06-2007, 01:24 PM
Automating MapPoint in C++ With Built In GPS Features Enabled

"Jonathan Oppelaar shows how he used techniques to overcome limitations in the MapPoint API to make MapPoint a better navigation platform for Project54, a in-car law enforcement system currently in use in over 1,000 vehicles."

Full article --

Automating MapPoint in C++ With Built In GPS Features Enabled (http://www.mp2kmag.com/a142--project54.police.navigation.mappoint.html)

jonp54
08-08-2007, 11:48 AM
If any one is also having issues with with the boolean functions that determine if a button was pressed, i found a more reliable method than what Paul was suggesting. Here is my IsTracking function. You have to include Oleacc.lib to your project or dynamically link the dll. I would recommend including it in your project.

int MapPt::IsTracking()
{
logFile<<"IsTracking()\n";
IAccessible * acc=NULL;

VARIANT idxIn;
VariantInit(&idxIn);
V_VT(&idxIn) = VT_I4;
V_I4(&idxIn) = CHILDID_SELF;

VARIANT idxOut;
VariantInit(&idxOut);
V_VT(&idxOut) = VT_I4;




// Obtain the IAccessible object from the parent window
HRESULT hr = AccessibleObjectFromWindow(m_hwBtnStartGPSTracking ,OBJID_CLIENT,IID_IAccessible,(LPVOID*)&acc);
if(SUCCEEDED(hr))
{
acc->get_accState(idxIn,&idxOut);
return V_I4(&idxOut);
}
else
return -1;

}

If you look in "Oleacc.h" you can see what the different values get_accState returns. There are probably 20 different states the button can be in. Search for SYSTEM_STATE_UNCHECKED in Oleacc.h and it will bring you to all the definitions.

 
Web mp2kmag.com
mapforums.com