Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

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 Desktop Discussion category; Hi Everyone: I sure hope someone can help. The environment is Vista Enterprise (UAC turned off), Microsoft Visual Studio 2008 ...

  1. #1
    jovo is offline Junior Member White Belt
    Join Date
    Nov 2007
    Location
    Holland MI
    Posts
    5

    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 Attached Files

  2. #2
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60

    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

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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 ?

  4. #4
    jovo is offline Junior Member White Belt
    Join Date
    Nov 2007
    Location
    Holland MI
    Posts
    5

    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

  5. #5
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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.

  6. #6
    theduck is offline 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

  7. #7
    jatkins is offline Junior Member White Belt
    Join Date
    Jun 2008
    Posts
    4

    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.

  8. #8
    Jamboo is offline Junior Member White Belt
    Join Date
    Jul 2008
    Posts
    7

    Smile Re: Mappoint 2006, C#, VS 2008, Vista, COM object problems

    Jovo. I hope you found a solution to your problem if not this may help.

    I was having the same prolblem and it is due to the DEP security level this is a solution that I warranty has worked for me.


    You can work around the issue by manipulating the control at run time. For Example - I was able to position the control at runtime using the following line of code:

    AxMappointControl1.Location = New System.Drawing.Point(100, 100)
    AxMappointControl1.Size = New System.Drawing.Size(New Drawing.Point(800, 600))

    When we run the project it throws the exception “Map point failed to load. The cause of this failure is unknown”, I was able to resolve the above error by following below steps :-

    1) Go to “Project->Properties” then select the “Compile” tab. In the “Compile” tab click the “Build Events…” button.
    2) In the “Post-build event command line” text-Area copy the following lines:
    call "$(DevEnvDir)..\tools\vsvars32.bat"
    editbin.exe /NXCOMPAT:NO "$(TargetPath)"
    3) Save the project, build it & try to run the project.

    If you still get the exception while running the project try the following:
    1) Do not remove the lines we entered in the post-Build event (in step 2 above)
    2) Press Ctrl+F5 to see if the application runs well without debugging.
    3) Open the project's Property page, and go to "Debug" tab. UNCHECK the "Enable the Visual Studio hosting process"
    4) Press F5 to see if the application runs well under debugging now.

  9. #9
    souravbikash is offline Junior Member White Belt
    Join Date
    Feb 2009
    Posts
    1

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

    hi.frnd am working with Visula studio 2008..my requirement is that i want to make a Windows mobile pocket pc applicatio...by which i can add map facilities.i have that map control dll..but when i add it in tool box ..the controls are not comming..plz tell me what to do?

  10. #10
    Jamboo is offline Junior Member White Belt
    Join Date
    Jul 2008
    Posts
    7

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

    Hi.

    I dont hav much experience with windows mobile, but could you explain the following a little more?

    1 What mobile OS are you trageting?

    2 When you say "when i add it in tool box ..the controls are not comming" can you explain dose the Mappoint control not show up in the tool box or dose it not show up on your form??

    3 What have you installed in your machine a full version of mappoint or the redisitribuable?

    4 are you trying to add the mappoint control or the streetmap control??

    brgds
    JB

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VB6 Com Add-In Not Working on Vista
    By dmaestro22 in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 02-11-2012, 03:40 PM
  2. Replies: 30
    Last Post: 02-06-2012, 11:33 AM
  3. MapPoint 2008????
    By davidb in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 03-10-2008, 06:04 PM
  4. VISTA and mappoint 2007 data importing
    By mastaBH in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 08-17-2007, 10:11 AM
  5. route object to drawing object
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-09-2003, 10:29 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 52 53 54 55 56 57 58 59 60 61 62 63 64 65