Community of VE/MapPoint Users and Developers
This is a discussion on Multi-threading in an add-in? within the Development forums, part of the MapPoint 2006/2009 Discussion category; I know VB6 prohibits it, but has anyone had any luck getting a .NET add-in to multi-thread? My ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Multi-threading in an add-in? My concern is to keep a GUI responsive. With VB6 this can be done using "sleep", which puts the current thread into the window/form's message loop for the set period. The closest sleep call in the .NET world literally halts a thread, which is no good. Another way might be to force a form to empty the message queue regularly? Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
| Re: Multi-threading in an add-in?
Richard, Your pardon please - I don't even own VS7 - but the example here: VB Helper: HowTo: Start multiple threads in VB.NET shows Thread.Sleep. Mike Mattys |
| ||||
| Re: Multi-threading in an add-in?
Thanks Mike, yes "Thread.Sleep" is what I was referring to as the equivalent in .NET. The problem is that this literally stops the thread for the specified period of time. I want to "process all messages", so I need a sleep that does that in the background. (VB6's sleep() does this). Following your link led me to go back to the online MSDN docs. There I found Thread.Join which does the required message processing BUT it needs to work on a second thread. So far that isn't working for me, and if I create a second thread then I might as well run the entire dialog box in its own thread (which is what I do in standalone apps). I'll probably give this a go next, although I know multiple threads in add-ins is prohibited in VB6 and I suspect all add-ins. Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| ||||
| Re: Multi-threading in an add-in?
My code is a bit messy still, but it looks like multi-threading is working!! My approach is to use asynchronous delegates, and you MUST run all MapPoint calls in the add-in's main thread. So my dialog box runs in a second thread as a modal dialog box. Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| ||||
| Re: Multi-threading in an add-in?
This is continued development of MPSuperShape. I'm expanding the import options to include .SHP and .MIF files (see my other post elsewhere). A customer sent a sample file of about 3Meg - it takes a few minutes to load, so I decided a "Working..." dialog box was required. Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multi-radius | Anonymous | Wish List | 2 | 06-29-2003 11:54 PM |
| multi polyshape query | henemonster | MapPoint 2006/2009 Discussion | 0 | 03-25-2003 06:10 PM |
| Multi-radius | Anonymous | MapPoint 2006/2009 Discussion | 1 | 02-26-2003 09:07 AM |
| [Multi pushpins selection ?] | Vincent BENNER | MapPoint 2006/2009 Discussion | 4 | 01-30-2003 04:41 AM |
| Mappoint newbie here- need to be able to map multi.... | Anonymous | MapPoint 2006/2009 Discussion | 3 | 06-13-2002 10:04 AM |
Borovets Ski Holidays
Borovets ski holidays are set amongst stunning scenery with a great selection of restaurants, hotels and nightlife. Borovets ski holidays are great value for money.
Travel Agency
We are a Queen's Award winning travel agency here to help with your travel plans.
Flight to Canada
Book a flight to Canada to explore one of the most exciting travel destinations in the world. There are loads of interesting cities but some even more impressive natural beauty.
Sri Lanka Holidays
There are some outstanding deals on Sri Lanka holidays at theholidayplace.co.uk. Sri Lanka is renowned for it's exceptional beauty! Book a holiday today!
Cheap Balearics Holidays
Cheap Balearics holidays are available if you know when to book and who to book with. The Balearics have many fascinating places to visit all year round. The partying never stops.
Bargain family holidays
We can help you find family holidays at bargain prices when you check out the options at Travel.co.uk
Holidays in Portugal
Find the perfect Algarve holiday. Book holidays in Portugal now at On The Beach.