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

MapPoin VB.Net

This is a discussion on MapPoin VB.Net within the MapPoint Desktop Discussion forums, part of the Map Forums category; Dear All I have a problem with MapPoint in my vb.net application. I use MapPoint to show my vehicles on ...

  1. #1
    mmjc23 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    9

    MapPoin VB.Net

    Dear All
    I have a problem with MapPoint in my vb.net application.

    I use MapPoint to show my vehicles on map.

    My application is a MultiThread application and when I try to show a GPS Position on Map while MapPoint is busy to build the route I have a 'server busy' error.

    Are there any properties or events to know when the MapPoint Activex is in busy state?

    I try to use the "ReadyStateChange" event but it doesn't occur during route building and other functions.

    Thanks Matteo

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

    The 'server busy' shows up because your application does not resond to windows messages.

  3. #3
    mmjc23 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    9
    Thanks Wilfried for answer

    But are there any properties or event to know when MapPoint ActiveX Control is busy state to prevent this error message?

    Thanks again
    Matteo

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

    The 'server busy' popup is in fact a very confusing message. It does not mean mappoint is busy, it means that mappoint is trying to process windows messages to your application and your application does not respond. But that's not all. I try to explain when it can show up:

    - Your application is not pumping messages on a (hidden) window. This can for example happen if it is looping somewhere during a long time. (I think >= 10 seconds). If that is the case then optimize the length operation or move it into a background thread.

    - Your application is pumping messages, but has a modal form in one of the Mappoint events. For example a popup menu.

    - If your application is multithreading and there is a hidden window created in one of the threads, be sure to have a working message pump in that thread. Note that this is not nececary if you have no window over there.

    There could be more reasons but this are the only one I am aware off. For example your application is multithreading. I think mappoint is thread safe, but I hope you dont access same mappoint instance from more than 1 thread, or does not call some methods from within a different thread context that the thread that created mappoint (normally UI thread).

  5. #5
    mmjc23 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    9
    Thanks a lot for your reply.
    The problem is that I call some methods from different threads.
    I probably solved my problem using a VB.NET "Mutex" class to syncronize different threads.

    In your opinion, would it be a solution declare MapPoint variable as "Shared"?

    Thanks a lot again
    Matteo

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

    Declaring as shared is in my opinion not a solution. You indeed probably solved the problem with synchronizing your threads. But I also think it is only temporary solved.

    If you create a component in a particular thread context, normally you have to call all his events also from within same thread context. Synchronizing does not help, the context is what matters.

    Note that synchronizing threads is actually disable multithreading

    If you really need thread, then I advice if you wants to call mappoint methods then do it in main thread context. The most easy way to do it is to PostMessage to the main thread. Then the custom message handler do the call.

    in dotNet you can easy P/Invoke this win32API call. I think in version 2 they have done it theirselve but I still use my own.

  7. #7
    mmjc23 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    9
    Thanks a lot for your help, Wilfried
    Now I will think about the situation.
    Bye Matteo.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Is there a patch or update to download for MapPoin....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-03-2002, 09:36 AM
  2. I am working on a large presentation using Mappoin....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-26-2002, 10:22 AM
  3. I've found many addresses that were not on MapPoin....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-05-2001, 11:11 AM
  4. Hello - I'm plotting point locations over MapPoin....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-11-2001, 11:18 AM
  5. Can 'customer symbols" be saved within the MapPoin....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-04-2001, 09:27 AM

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