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
Results 1 to 8 of 8

ActiveX control fails in VS2005, but was fine in VS2003

This is a discussion on ActiveX control fails in VS2005, but was fine in VS2003 within the MapPoint Desktop Discussion forums, part of the Map Forums category; I have Mappoint 2004, and had a nice app working with VB.NET 2003 I have just installed VS 2005. Registering ...

  1. #1
    jtowell is offline Junior Member White Belt
    Join Date
    Mar 2004
    Posts
    7

    ActiveX control fails in VS2005, but was fine in VS2003

    I have Mappoint 2004, and had a nice app working with VB.NET 2003

    I have just installed VS 2005.
    Registering the mappoint control was slightly different from how it was in 2003, but it appeared in the toolbox seemingly correctly.

    I create a main form, with nothing else on. It runs OK.

    I add a mappoint control from the toolbox. No code, just the control.
    I press F5 to run, and the error produced is:
    An error occurred creating the form. See Exception.InnerException for details. The error is: ActiveX control '8f78d7fc-bae4-46a4-a79a-052356ab3dd4' cannot be instantiated because the current thread is not in a single-threaded apartment.

    I can't get past this first very basic hurdle. Any ideas?

    James

  2. #2
    luoo is offline Junior Member White Belt
    Join Date
    Mar 2006
    Posts
    1
    I have a similar error @ my 64 bit machine. and work fine my 32 bit.
    Hope this help.
    John

  3. #3
    jtowell is offline Junior Member White Belt
    Join Date
    Mar 2004
    Posts
    7
    For me, both projects are on the same machine, a Dell Latitude.
    Have you resolved your problem? - James

  4. #4
    jtowell is offline Junior Member White Belt
    Join Date
    Mar 2004
    Posts
    7
    I've found a post:
    http://support.microsoft.com/default...en-us%3B841295
    which seems to address the problem.

    I can't find any reference to 'thread' nor 'MTA' in my code nor in the hidden generated code.

    Has anyone got activeX control to work in VS2005?

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

    Yep, works fine here. VS2005 and dotNet 2.

    But what I can understeand from this message is that it complains because it is called in a thread context. You cannot call any GUI in another thread than mainthread. Or do I misundersteand the mesage ?

  6. #6
    jtowell is offline Junior Member White Belt
    Join Date
    Mar 2004
    Posts
    7

    Confession

    I have a confession. I actually did not start from a clean project. I deleted all the forms in my VB2003 project and then converted to VS2005. By the time I'd spoted the error, I think I'd forgotten. It's interesting that after the initial panic and relaxing over the weekend, I wrote out another request for assistance, and this time read it over checking the truth of every sentence I'd written, and then it hit me. So I actually created a new project and it works fine.
    Apologies and thanks to anyone who's put in effort due to this.
    -James

  7. #7
    jtowell is offline Junior Member White Belt
    Join Date
    Mar 2004
    Posts
    7

    Confession

    I have a confession. I actually did not start from a clean project. I deleted all the forms in my VB2003 project and then converted to VS2005. By the time I'd spoted the error, I think I'd forgotten. It's interesting that after the initial panic and relaxing over the weekend, I wrote out another request for assistance, and this time read it over checking the truth of every sentence I'd written, and then it hit me. So I actually created a new project and it works fine.
    Apologies and thanks to anyone who's put in effort due to this.
    -James

  8. #8
    ANDYL is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    4

    Re: ActiveX control fails in VS2005, but was fine in VS2003

    I have encountered the same error after converting VS2003 VB Winform control to VS2005 which has a MapPoint control embedded in it.
    My app contains a Windows.Forms.UserControl class with MapPoint control embedded on it and a test form I use to develop and debug the UserControl. I tried tagging the Sub Main with <STA...> attribute as per MSDN article with no success.

    When I embed the usercontrol in my ASPX page it just crashes the page.

    This usercontrol is intended to be accessed embedded in an ASP.NET page via IE7.

    I'm stuck. Do I need to dump MapPoint?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error using ActiveX control in VB 6
    By bgower in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 09-16-2005, 09:40 AM
  2. Re: Keyboard control in mappoint activex control
    By djcapslock in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-10-2005, 11:16 AM
  3. mappoint ActiveX control 9.0
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-21-2004, 07:22 AM
  4. Getting [SelectedArea] from an ActiveX control
    By Bug in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-19-2004, 11:43 AM
  5. ActiveX Control
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-04-2002, 06:44 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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96