Community of VE/MapPoint Users and Developers
This is a discussion on Mappoint and a .Net Console App within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am trying to use Mappoint in a .Net Console app. I don't need to see the map, I just ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Mappoint and a .Net Console App This is what I have Dim objMap As New AxMapPoint.AxMappointControl() objMap.NewMap(MapPoint.GeoMapRegion.geoMapNorthAme rica) The latter command errors immediately with the following message: "Exception of type InvalidActiveXStateException was thrown." I have no other Mappoint related statements before this point. Anyone have any thoughts on that? |
| ||||
|
There's several .Net / MapPoint desktop apps on this website, I think the simplest and most relevant to your inquiry might be: http://www.mp2kmag.com/a69--automate....mappoint.html Hope this helps! Eric
__________________ |
| |||
|
Eric, I appreciate the response. I was able to get my situation to work by adding a windows form to my console app, adding a Mappoint control to that form, and just never showing the form. But I wanted to to try your solution. Did someone just write that, or did they actually try it? Here's why I ask. When I copy and paste the solution as is, I get several compile errors. 6 with the project setting "Strict" on (which I normally use), and 3 with it off. Here are the errors. 1&2) Dim WithEvents oMpApp As MapPoint.Application Dim WithEvents oMap As MapPoint.Map Withevents variable does not raise any events 3,5&6) oMpApp = GetObject(, "MapPoint.Application") myLoc = oMap.FindAddressResults(, , , states(I), , "USA")(1) oMap.SaveAs(states(I), 2) Option Strict On disallows implicit conversions from 'System.Object' to 'MapPoint.Application' 4) oMpApp = New MapPoint.Application() 'New' cannot be used on an interface. I can get around the other 5......I don't know how to get around this one. Ed |
| |||
|
I second EdBick's situation as I am getting the same error when trying to use New on MapPoint.Application. I had to resort to CreateObject() function to get around this problem, which is inconsistent with many MapPoint samples out there. The other strange problem I couldn't resolve is why GetPictureFromObject() always returns some default map of the North-Western US region even if the actual map is totally different (and yes, I have saved it before calling GetPictureFromObject()). Alex |
Cheap Flights Paphos
Have a fantastic holiday in Paphos. Enjoy the lively seafront atmosphere and the picturesque mediaeval port. Book cheap flights online at Holiday Hypermarket.
City Breaks
Top 10 City Breaks . Based on holidays booked this year, these are the most popular City Breaks for 2006
Holiday Italy
A Holiday in Italy can mean many different things to many different people. This diverse country has an abundance of art, wine, food and stunning beaches. Book online today.
Bahamas Holidays
Bahamas Holidays offer pure blue skies, soft white beaches and the holiday of a lifetime. Visit us for a great deal to the Bahamas.
Portugal
As well as providing some great weather Portugal has much to offer culturally. There are numerous museums, monuments and places of historical interest to explore. Despite the rich history there is a buzzing nightlife and great shopping too.
Package Holidays
With the help of Travel.co.uk you can find the package holidays of your dreams.
Holidays to Gran Canaria
The Canary Islands await! Book holidays to Gran Canaria online at On The Beach!