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 2 of 2

MapPoint 2006 ActiveX with new Form

This is a discussion on MapPoint 2006 ActiveX with new Form within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi there, same probleme again. I included the MapPoint Control 13.0 in a Visual Studio Project, made a Button on ...

  1. #1
    jasanite is offline Member Yellow Belt
    Join Date
    Jul 2007
    Posts
    45

    Question MapPoint 2006 ActiveX with new Form

    Hi there,
    same probleme again.
    I included the MapPoint Control 13.0 in
    a Visual Studio Project, made a Button
    on my Form and did this:

    Form myForm = new Form();
    AxMappointControl mapPoint = new AxMappointControl();
    myForm.Controls.Add(mapPoint);
    mapPoint.NewMap(MapPoint.GeoMapRegion.geoMapEurope );
    myForm.Show();

    On Line mapPoint.NewMap(...) i get System.Windows.Forms.AxHost+InvalidActiveXStateExc eption

    if i try this:

    Form myForm = new Form();
    myForm.Show();
    AxMappointControl mapPoint = new AxMappointControl();
    myForm.Controls.Add(mapPoint);
    mapPoint.NewMap(MapPoint.GeoMapRegion.geoMapEurope );

    everything works fine

    Where is the probleme?

  2. #2
    jasanite is offline Member Yellow Belt
    Join Date
    Jul 2007
    Posts
    45

    Re: MapPoint 2006 ActiveX with new Form

    Hi there, no, i won't write "I got the solution, thanks, bye".

    The problem was that the activeX wasn't completly
    initialized, in which way ever the show method of the
    form called the EndInit() Method of the ActiveX and made
    the usage afterwards possible.

    Solution: Just call it yourself.
    Form myForm = new Form();
    AxMappointControl mapPoint = new AxMappointControl();
    myForm.Controls.Add(mapPoint);
    mapPoint.EndInit(); // <- That's the way
    mapPoint.NewMap(MapPoint.GeoMapRegion.geoMapEurope );
    myForm.Show();

    Sry for my bad and irritating english, i'm german an not quite
    used to write or talk in english. Hope this helps some of you.

    Give me some hinds if the problem was totally clear and i'm just
    dumb ^^

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Mappoint and Access with ActiveX On A Form
    By jpateusa in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 05-16-2009, 07:32 PM
  2. MapPoint 2006 with ActiveX
    By jasanite in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 08-10-2007, 11:05 AM
  3. VC++ doesn't find MapPoint 2006 ActiveX control
    By DrNobody in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 02-22-2007, 10:41 AM
  4. Mappoint 2006 ActiveX Questions
    By ben_dillon in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 01-31-2007, 07:16 AM
  5. mapPoint 2006 activex control slow down form closing
    By bule in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-26-2006, 02:22 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