Map Point 2002 Error Message

VeGeTa-X
10-15-2007, 01:43 PM
Greetings,
I am receiving an error message when I am try to launch mappoint 2002 from xatanet.com. I have pasted a pic of the error message below also I will paste the text below that if any has come across this error message please let em know. Thx


http://i68.photobucket.com/albums/i39/VeGeTa-X/mappoint.jpg

**Error Message from above**

System.InvalidCastException: Unable to cast COM object of type 'MapPoint.MapClass' to interface type 'MapPoint._Map'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{90B167C0-923D-4B65-AEE2-66938491C916}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at MapPoint.MapClass.GetLocation(Double Latitude, Double Longitude, Double Altitude)
at Xata.XataNet.MapControl.ClientMap.SetItem(Double dLat, Double dLong, String strName, String strText, Int16 sSymbol, GeoBalloonState labelState)
at Xata.XataNet.MapControl.ClientMap.GenerateMapImage ()

Winwaed
10-16-2007, 08:07 AM
It should be ._Map - and it is trying to cast to that.
What is MapClass - is this something you've created, or your environment has created?

I don't know xatanet.com, but it looks like the COM interface might be pretty low level? In which case it might be instructive to look at C++ examples without MFC. Eg:

Calling MapPoint From C++ Without the MFC Safety Net - MapPoint Articles - MP2K Magazine (http://www.mp2kmag.com/a106--c++.without.mfc.mappoint.html)

The application object's ActiveMap property returns a _MapPtr - you need to cast this to get a _Map ptr. Eg. in the above example:

// Most operations are through the map object, so get a pointer
// to the current _Map object
_MapPtr myMapPtr = myMapPoint->ActiveMap;
_Map* myMap = (_Map*)myMapPtr;
ATLASSERT( myMap!=NULL );


Richard

Wilfried
10-16-2007, 08:11 AM
Hi,

this can be an invalid typecast. can also be if the application that uses mappoint is running as NT service, if the latter then you have to click OK on the EULA when it runs as service.

what is the programming language, and can you show the line of code with the exception?

 
Web mp2kmag.com
mapforums.com