Hi there,
I've got the following problem:
I am trying to build a simple application with VS 2005 and MapPoint 2004. I have read an article (http://www.mp2kmag.com/a103--chandu.thota.net.framework.mappoint.html) and tried the given example. It didn't work...
So I tried to build the code line by line:
At line four I get an InvalidCastException (InvalidCastException: Unable to cast COM object of type "MapPoint.ApplicationClass" to interface type "MapPoint._Application") (the message may vary, though I translated it from German). Even before this line is executed, the debugger gives me the information, that the object app has InvalidCastExceptions on all variables...Code:using MapPoint; /* ... */ public void makeMap() { ApplicationClass app = null; app = new ApplicationClass(); app.Visible = true; /* ... */ }
I must add, that the code I tried here, was originally developed for VS .NET. Could that be the problem?
Maybe someone can help me, I'm looking forward to.
Thanks
Christian
PS: The original error message is: InvalidCastException was unhandled
Das COM-Objekt des Typs "MapPoint.ApplicationClass" kann nicht in den Schnittstellentyp "MapPoint._Application" umgewandelt werden. Dieser Vorgang konnte nicht durchgeführt werden, da der QueryInterface-Aufruf an die COM-Komponente für die Schnittstelle mit der IID "{D6D389CE-1781-47A0-8984-4349687F65D6}" aufgrund des folgenden Fehlers nicht durchgeführt werden konnte: Schnittstelle nicht unterstützt (Ausnahme von HRESULT: 0x80004002 (E_NOINTERFACE)).
PPS: Why is the forum search engine finding zero mathches for "C#"?