Does anyone know if there is an equivalent call to
App.OleRequestPendingTimeout = TimeInMiliseconds
for VBA.
This is a discussion on Server Busy within the MapPoint Desktop Discussion forums, part of the Map Forums category; Does anyone know if there is an equivalent call to App.OleRequestPendingTimeout = TimeInMiliseconds for VBA....
Does anyone know if there is an equivalent call to
App.OleRequestPendingTimeout = TimeInMiliseconds
for VBA.
Does somebody has found it allready in c#?
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.
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
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...b;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
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
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.
Looks like Joel has the answer to the VBA code problem.
What you want to do when handling events like:
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.Code:Private Sub MPC_SelectionChange(ByVal pNewSelection As Object, ByVal pOldSelection As Object)
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
then, to handle the MapPoint ChangeSelection event, writeCode:Public TimerProc as String
The code in the timer event should look likeCode:Private Sub MPC_SelectionChange(ByVal pNewSelection As Object, ByVal pOldSelection As Object) TimerProc = "SelectionChange" TimerInterval=1 End Sub
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.Code: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 "ProcThatMustBeRunFromThisFormModuleButYouWantToCallfromOutside" <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
Don't forget to set
above theCode:TimerInterval = 0
code in the Timer EventCode:Select Case TimerProc
There are currently 1 users browsing this thread. (0 members and 1 guests)