| | Sylvain 01-15-2004, 06:51 PM Hi everyone,
XP Pro SP1, Mappoint 2002, VB6 SP5,
I have a PC running exclusively a tracking system 24 hours a day displaying vehicle’s movement on a map. A few times a day, the application crash giving a Mappoint unexpected error saying “Server busy” asking to “Switch to” or “Retry”. In the program, I’m capturing the error, not always at the same place, but always referring to the map, and I can’t regain control of the program because of the ‘Switch to’ message. No matter what I try, I have to shutdown the application using ‘Task Manager’ and then restart the PC to reuse Mappoint’s control object.
Does anyone have any suggestions or encounter this type of error? Can I avoid having that message showing? What does the ‘Server Busy’ really mean? John Meyer 01-16-2004, 07:49 AM You cant avoid having that message show. Your going to have to narrow it down and when you do if you post the code that you think is doing it we might be able to help.
Also I know its been talked about alot here in this forum so if you did not already search here give that a try.
When I've seen this message it usually is code that uses one of the events so look there first. afterburn 01-16-2004, 02:51 PM actually the error is generated by the timeout expiring but not releasing the control thread back your app in a timely manner..
this can be resolved with any COM based object in VB by adding the line
App.OleRequestPendingTimeout = TimeInMiliseconds
to the length needed for the query.... Sylvain 01-20-2004, 06:05 AM Thanks you both,
I've increased the default value of OleRequestPendingTimeout and it's been running for the last few days.
Thanks again,
Sylvain Anonymous 03-02-2004, 02:15 AM Does anybody know how can I solve the problem in .net. I'm implementing an application in C#.net and when I try to show a DialogForm it appears the error message "Server Busy ..." Please tell me how to solve it!
Thanks everybody!!! Anonymous 03-16-2004, 06:32 PM hey umm....i dont know much about comps so umm....i have the server busy problem too like sylvania....whats App.OleRequestPendingTimeout anyways....? Anonymous 03-22-2004, 12:00 AM is anybody gonna answer me? Winwaed 03-22-2004, 08:36 AM Didn't see your post the first time around.
It is a property setting for COM.
So if you're using Visual Basic, you need to use that line.
For other languages, you'll need to look at your 'calling COM' documentation.
For MFC I think I read somewhere that it was hard-coded but I'm not sure.
It isn't something I've need to change - I've only seen the error in one circumstance, when running batch jobs in the background and test/developing in the foreground.
A faster PC would help as well! :-)
RB Anonymous 03-24-2004, 07:37 PM where do u find that documentation? Winwaed 03-25-2004, 07:36 AM Well what language are you using?
For some, try searching the web. Eg. I think Perl has a library to do it.
For a Microsoft language, then MSDN (on their website) is probably a good place to start.
Richard Anonymous 05-07-2004, 10:35 AM Does anyone know if there is an equivalent call to
App.OleRequestPendingTimeout = TimeInMiliseconds
for VBA. Anonymous 05-17-2004, 04:37 AM Does somebody has found it allready in c#? Anonymous 06-15-2004, 04:30 PM I got the "Server Busy" error saying "This action could not be completed because (my app) is not responding". My C++ .NET app was processing an input file of GPS points. The error went away when I added some well placed "axMappointControl1->MousePointer;" lines in the loop. Anonymous 06-16-2004, 04:18 PM Hi
In .NET you can try
Private Sub KillMapPointProcess()
Dim proc As New Process
Dim procs As Process()
Dim i As Integer
procs = proc.GetProcessesByName("MapPoint")
If procs.Length = 0 Then Return 'MP wasn't loaded, so return
For i = 0 To UBound(procs)
procs(i).Kill()
procs(i).WaitForExit()
Next
End Sub
In VB6 I had the same problem until I closed ALL objects with = NOTHING
Since then no problems anymore
Wim Anonymous 06-23-2004, 06:06 AM Hi,
I have a VC++ project and embedded MapPoint as an ActiveX in a Dialog-Box.
When I let MapPoint calculate a route between 2 points that are close to each other... everything works fine.
As soon as I try a route between 2 points that are far away from each other -> the calculation takes more than 20 seconds (!!) and after that a "Server Busy, Switch To..." dialog is popping up.
I tried all the things from
http://support.microsoft.com/default.aspx?scid=kb;EN-US;248019
But still I have the problem...
Did anybody solve this in VC++ ?
Thanks
Gustav What I used to do when using MapPoint with C++ was to post a custom message to the parent window, when MapPoint fired an event. Then I would handle the custom message accordingly.
i.e. If I wanted to calculate a route after the user has clicked a second spot on the map, I get the SelectionChanged event from MapPoint (or whatever the event is called, I forget). Then I post my own custom message (say WM_USER) to the control's parent window. Then on the handler for WM_USER, I have it calculate the route. MapPoint only seems to complain if you take too long handling an event that it launched. So by posting another event, and letting the MapPoint event terminate, it's happy.
In C# now, I just have a timer (too lazy to play with posting messages) that I set to 50ms from a MapPoint event. Then the timer triggers the code I want to fire when as a result of the Map event.
I hope this makes sense.
Joel Anonymous 07-06-2004, 02:25 AM Hey Joel,
Thanks a lot. I tried the "timer thing" - a possible solution you described.
And it works! No more "Server Busy"-Dialogs!!!
It really seems that MapPoint wants to terminate its own events quickly!
Cool! Thank you.
Gustav Anonymous 07-07-2004, 03:01 AM Hi, I'm programming in vb .NET
I read about a timer to solve the "server busy" problem.
Could someone please help me to achieve this solution in VB.NET?
I'm desperated.
Thanks. Anonymous 08-11-2004, 02:44 PM Looks like Joel has the answer to the VBA code problem.
What you want to do when handling events like:
Private Sub MPC_SelectionChange(ByVal pNewSelection As Object, ByVal pOldSelection As Object)
is to exit the sub first, and then execute the code your want to run when the MapPoint event fires. That way you avoid the 20 second time-out.
His solution is the only way I know how to do it: set a timer. Timers fire after the current procedure has finished executing, or upon a "DoEvents."
You will find this technique useful for a lot of other reasons, so I suggest that you set up your timer event to handle a variety of procedures. To do this, declare a public variable for your form that can be accessed from outside the form.
Let's say that the form that contains the MapPoint control is called "MapForm." Declare a public variable at the top of the MapForm code, like
Public TimerProc as String
then, to handle the MapPoint ChangeSelection event, write
Private Sub MPC_SelectionChange(ByVal pNewSelection As Object, ByVal pOldSelection As Object)
TimerProc = "SelectionChange"
TimerInterval=1
End Sub
The code in the timer event should look like
Select Case TimerProc
Case "SelectionChange"
<insert the code the handle the SelectionChange event here>
Case "MouseUp"
<insert the code the handle the MouseUp event here>
Case "ProcThatMustBeRunFromThisFormModuleButYouWantToCal lfromOutside"
<use the DoEvents command to get this code to run in-line from an external procedure. The TimerProc variable is referenced as MapForm.TimerProc>
End Select
You might also need to set some form level variables to capture the values passed by MapPoint (pNewSelection, pOldSelection) so that you can reference them from the Timer Event. Anonymous 08-11-2004, 03:03 PM Don't forget to set
TimerInterval = 0
above the
Select Case TimerProc
code in the Timer Event vidyakulkarni 08-11-2004, 04:34 PM i need solution for server busy in C# ..please help me Anonymous 09-18-2004, 04:25 PM Does anybody know how can I solve the problem in .net. I'm implementing an application in C#.net and when I try to show a DialogForm it appears the error message "Server Busy ..." Please tell me how to solve it!
Thanks everybody!!! | |