MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Mappoint 2006, C#, VS 2008, Vista, COM object problems

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion > Development

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-27-2007
Junior Member
White Belt
 
Join Date: Nov 2007
Location: Holland MI
Posts: 4
Mappoint 2006, C#, VS 2008, Vista, COM object problems

Hi Everyone:

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
Attached Files
File Type: zip MapTest7.zip (9.7 KB, 8 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 11-28-2007
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 776
Blog Entries: 4
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 11-29-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 12-04-2007
Junior Member
White Belt
 
Join Date: Nov 2007
Location: Holland MI
Posts: 4
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 12-07-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 06-16-2008
Junior Member
White Belt
 
Join Date: Jun 2008
Posts: 1
Re: Mappoint 2006, C#, VS 2008, Vista, COM object problems

Hi
Has anybody found a solution for this issue sofar?
LG
Daniel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 06-18-2008
Junior Member
White Belt
 
Join Date: Jun 2008
Posts: 1
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/mappoint-2006-c-vs-2008-vista-com-object-problems-6810.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 03:44 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51