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 16

Optimize Progress Bar

This is a discussion on Optimize Progress Bar within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi! Is there a way to show the Optimise progress bar in a VB app, like in Mapppoint 2004 ? ...

  1. #1
    Metod is offline Junior Member White Belt
    Join Date
    Oct 2005
    Posts
    3

    Optimize Progress Bar

    Hi!

    Is there a way to show the Optimise progress bar in a VB app, like in Mapppoint 2004 ?
    Some times process can be very long, so users can't see if it's still computing or crashed.

    Thanks for your answer.

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

    Tell your users you write crashFree programs so they dont have to worry

    Which process you want to show a progress bar for ?

  3. #3
    Metod is offline Junior Member White Belt
    Join Date
    Oct 2005
    Posts
    3
    Hi!
    Thank you for your answer !
    Well, I think my customers haven't funny taste like us
    So here is a copy of what I want to do :
    http://img251.imageshack.us/img251/494/mappoint4ye.jpg

  4. #4
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    I think you have to multi-thread your addin so that the status bar is animated whilst MapPoint is processing.

    From what I remember, multi-threaded VB is not allowed for MapPoint add-ins which run "in-process".

    I've done some status updates with timers, but I don't think this will work in this case. The timer call will wait until the optimise route has finished!

    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

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

    Richard is right, Mappoint blocks the message pump while it calculate a route. About threading, visual objects are not threadsafe in general, so a form is not.

    What is easy to do is spamn another application that only display the form in the center of the form of the map with a progress bar. The calculated time may be a gues, but you can experiment a little and let the program guess it depending on the amount of stops. Should be more or less OK.

    So you launch the application in your code before calculating route, and when it is calculated you post a WM_QUIT message to that application which will then exit. Your form (with mappoint) will not have focus because message pump is blocked, so progressbar will stay visible.

    Maybe better ideas but this is the best I can come up with at the moment..

  6. #6
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    Wilfried: That's a good idea. Could be fiddly in VB, but it is essentially "coarse grained" threading.



    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  7. #7
    Metod is offline Junior Member White Belt
    Join Date
    Oct 2005
    Posts
    3
    ok, thank you!

    Finally I think the crashfree statement is the best solution

  8. #8
    Joel is offline Junior Member White Belt
    Join Date
    Aug 2003
    Posts
    10

    Or...

    Here's what I use in C# which does exactly what you want

    SendMessage(FindWindow(null, "Map - Microsoft MapPoint North America"), WM_COMMAND, 35388, 0);

    Needs SendMessage imported from User.dll

    Doesn't anyone here use Spy++ any more?

    Joel

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

    He does not need to import since he use VB (not dotNet) so he can just call the win32 API. However, can you explain what you do ?

    I understeand the WM_COMMAND message. It is sent when accelarator key's are used or when menu item is selected. But where do you get the WParam value from ? I know it is notif code and ident but how do you know both of the values ?

    Maybe I have to check Spy++ as you mention. What is URL of it?

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

    Quote Originally Posted by Metod
    Finally I think the crashfree statement is the best solution
    Whell it is the most professional answer you can give to a customar. The strange thing is that they always beleive it Also you can raise the invoice without test period !!!

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. Optimize multiple stops
    By petekk in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 09-29-2005, 05:09 PM
  2. Handling Route that Calculates but does not Optimize
    By Eric Frost in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 03-07-2005, 03:07 PM
  3. Optimize Events
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 12-03-2003, 12:45 PM
  4. Optimize and calculate a Route
    By rms62 in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-22-2003, 03:55 PM
  5. Route optimize: shortest vs quickest
    By David Kachuck in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-16-2002, 08:23 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