Community of VE/MapPoint Users and Developers
This is a discussion on Mappoint 2006, C#, VS 2008, Vista, COM object problems within the Development forums, part of the MapPoint 2006/2009 Discussion category; Hi Everyone: I sure hope someone can help. The environment is Vista Enterprise (UAC turned off), Microsoft Visual Studio 2008 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Mappoint 2006, C#, VS 2008, Vista, COM object problems I sure hope someone can help. The environment is Vista Enterprise (UAC turned off), Microsoft Visual Studio 2008 (Release, NOT orcas beta 2), Microsoft Mappoint 2006, C# language. If I create a new windows form application, add the Mappoint COM object to the toolbox (Mappoint control 13.0), then drop it on the form, then try to run it... she fails with.. "InvalidOperationException" Cross-Thread operation not valid: Control 'axMappointControl1' accessed from a thread other than the thread it was created on. This is like the 'hello world' of putting a mappoint object onto a form. The problem started with Orcas Beta 2 and has not gone away for myself or any of our developers. The result is our application, which used mappoint since 2004, can no longer bring up a mappoint map at all because of this failure. For grins, I have attached this ultra simple mappoint test. Mappoint 2006 is loaded on the machine and does come up if I run it manually (As a separate program), but I can't get it to come up on a windows form at all, from anything (wheras, we had no trouble with VS 2005). Anybody else run into this strange and bizzare interaction for the COM object in VS 2008? Any suggestions are appreciated. Thanks Jovo |
| ||||
| Re: Mappoint 2006, C#, VS 2008, Vista, COM object problems
I haven't played with VS2008 & C#, but I know that Microsoft have been busy adding multi-threading tools to the latest versions of .NET and C#. Could it be that there's a default setting changed for the form, so that it is doing what the error says? Ie. different threads are being used to create and access control? Some of the new multi-threading stuff looks pretty neat - eg. a foreach that works a bit like the old vector processing operatives seen on Crays, Convexes, etc. Shame it will be a few years before a substantial number of PCs have it installed as standard... Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
| Re: Mappoint 2006, C#, VS 2008, Vista, COM object problems
Hi, Are you very sure you don't access any of the mappoint things from in another thread as the one where the form is created ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Mappoint 2006, C#, VS 2008, Vista, COM object problems
Hi Wilfried - I appreciate your asking, but that is why I posted the project. The project posted is simply, create a new windows form, drop the mappoint control on the form and try to run the program. On VS 2008 (release) running framework 3.5 (release) on MS vista (32 bit, enterprise edition -- any edition fails), the cross-threading error comes up. There is no additional coding in place. Please try the project on a vista machine with vs 2008 and mappoint. If it somehow works for you where it has failed on all 20 of our vista test environments and development machines, then I would very much like to know how to get it to work on vista. The same project, compiled.. may run on Win XP. In particular, if I use AxInterop.Mappoint.dll generated by VS 2005 (the older vs) on an XP machine, then mappoint comes up fine on an XP machine. But not vista... the cross-threading error happens. Last edited by jovo; 12-04-2007 at 03:05 PM. Reason: spelled the name wrong |
| |||
| Re: Mappoint 2006, C#, VS 2008, Vista, COM object problems
Hi, I have no Vista machine here, and still not installed VS2008. But you could try if it is indeed running in same thread using GetCurrentThreadId (which has been deprecated) or ManagedThreadId because then you can determine if it is a bug in vista or in VS2008.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Mappoint 2006, C#, VS 2008, Vista, COM object problems
Hi, I just tried this for you in VS2008 and get the same error message as you. I googled for the error and found this which may be useful. http://www.microsoft.com/communities...&cr=&sloc=&p=1 I've not tried the suggestions in VS2008 as I use still use 2005 and it sounds like the workaround may work for some and not others. John. |
![]() |
| ||||
| Posted By | For | Type | Date | |
| Microsoft MapPoint 2006 - MP2K Magazine | This thread | Refback | 12-04-2007 01:39 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 11-29-2007 09:17 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MapPoint 2006 object initialization fails in ASP.NET 2.0 | dawa | Development | 22 | 1 Week Ago 03:04 PM |
| MapPoint 2008???? | davidb | MapPoint 2006/2009 Discussion | 4 | 03-10-2008 06:04 PM |
| VISTA and mappoint 2007 data importing | mastaBH | MapPoint 2006/2009 Discussion | 8 | 08-17-2007 10:11 AM |
| VB6 Com Add-In Not Working on Vista | dmaestro22 | MapPoint 2006/2009 Discussion | 5 | 05-15-2007 07:06 AM |
| route object to drawing object | Anonymous | MapPoint 2006/2009 Discussion | 1 | 05-09-2003 10:29 PM |
France Ski Holidays
When you want to book France ski holidays, make sure you check out our travel guide. Holiday Hypermarket brings you the latest great deals.
Turkey Weather
Check out Turkey Weather - Travel Counsellors details information on Turkey including, weather, flights and accommodation.
Canada Flights
Canada flights are great value flights when you visit dealchecker.co.uk first. Full of surprises, Canada is simply the most astonishingly beautiful country in the world.
Holidays to Antigua
The Holiday Place has fantastic deals on holidays to Antigua. Visit our website to view special offers on holidays to the Caribbean.
Cheap Portugal Holidays
Want to know what the best time to book cheap Portugal holidays is? Well have a look on ulookubook.com for some useful information to save your cash. Golf, tennis and cycling are all very popular here.
Family Holidays
Family holidays can be great fun. Check out your options at Travel.co.uk
Cheap Gran Canaria Holidays
Want to take a break and visit the Canary Islands? Get information on cheap Gran Canaria holidays at On The Beach.