Community of VE/MapPoint Users and Developers
This is a discussion on Error "overflow execution stack" while readinq a within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I am using a MapPoint 2004 Activex. Is there a limit in the number of records in the object ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Error "overflow execution stack" while readinq a I am using a MapPoint 2004 Activex. Is there a limit in the number of records in the object RecordSet? I have an error while reading a RecordSet. Code: MyRecordSet.MoveFirst
Do while MyRecord.EOF = False
' Message(MyRecord.PushPin.Name
MyRecord.MoveNext
LOOP
Thanks for your help Mohamed from CasaBlanca |
| |||
|
Hi, I dont know if there is a limit, but if you have 8000 pushpins on the map then reading 2000 of them cannot be a problem. But I see something in your code: Code: Message(MyRecord.PushPin.Nam Another reason could be that there is something recursered. Eg you call a method whitch fires an event witch calls a method again etc and at some point fires the same event or calls one of the same methods. This way you can flow the stack also easy over. Do you have the stack overflow also if you just loop in the recordset without doeing anything els e?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| overflow stack in reading Recordset
Hi Wilfried, Thanks a lot for your answer. Very funny your Jokes in Mestdagh.biz ! Do you have the stack overflow also if you just loop in the recordset without doeing anything els e? [/quote] I still have the overflow stack when I just loop, but It stops at the records # 4000. But, anyway I have to do something with the records names, for instance to put them in a list!! I don't understand! Something works: I loop 5 times after deleting the pushpins I've seen in a previous loop. Thanks again for your answer. Mohamed |
| |||
|
Hi Mohamed, I just tryed out following code, which does create 8000 pushpins and loop trough the dataset without any error: Code: int n = 0;
Location Loc = MP.ActiveMap.GetLocation(50, 4, 1);
while (n < 8000) {
MP.ActiveMap.AddPushpin(Loc, n.ToString());
n++;
}
n = 0;
object o = "My Pushpins";
MapPoint.DataSet ds = MP.ActiveMap.DataSets.get_Item(ref o);
Recordset rs = ds.QueryAllRecords();
rs.MoveFirst();
while (!rs.EOF) {
Console.WriteLine(rs.Pushpin.Name.ToString());
rs.MoveNext();
}
But wy are you looping trough 8000 records? ths take extremely long time. Ifyo try to seek a name of a pushpin and do something with it, then you have to keep an array of used pushpins and loop trough it.. If this still take mutch time you can sort them by name and search trough it eventually with an index mechanism like in a database.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Stack overflow
Hi Wilfried, I am using my MapPoint Activex with Windev 9. May be the problem comes from that language. I've sent the message error to the Windev-Support. I hope they will give me a solution. Otherwise I will try with VB6. I've translated your test code as following, and I have the same stack overflow error at the same moment ( num = 4312 ): Code: n, num, nbrecords sont des entiers
ObjRecords, ObjDatSet, ObjMap, ObjLoc, ObjPin sont des objet Automation dynamique
cMagasin est une chaîne = ""
ObjMap = MapPointControl1>>activemap
ObjLoc = ObjMap>>GetLocation(50, 4, 1)
TANTQUE n < 8000
n++
Trace(n)
ObjMap>>AddPushpin(ObjLoc, NumériqueVersChaine(n));
FIN
ObjRecords = ObjMap>>DataSets>>item(1)>>Queryallrecords
nbrecords = ObjRecords>>Parent>>RecordCount
Info(nbrecords)
num = 0
ObjRecords>>MoveFirst
TANTQUE ObjRecords>>EOF = Faux
num++
ObjPin = ObjRecords>>PushPin
cMagasin = Majuscule(ObjPin>>Name)
// Here error when Num = 4312
Trace(num,cMagasin)
ObjRecords>>MoveNext
FIN
"Votre code a provoqué un dépassement de la pile" Thanks again for your help. Mohamed |
| |||
|
Hi Mohamed, Translation seems ok. I dont know Windev, but is it possible to if the exception occure to view the stack ? Or at least the call stack ? Is it also possible in Windev to do inline assembler ? (eg to put ESP and EBP into a variable for displaying) Or to set a break and view CPU registers, eg after every thousand loop ? I also see you dont need to define variables in the loop. I assume Windev define itself. Maybe a bug that stack grow deeper in the loop itself ? Hmm just brainstorming maybe you or others have better (or more intelligent ideas on how to debug this ps: is it always 4312 ? You nentioned other numbers in previous posts (please check, it may or may not be importand)
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| error, overflow execution stack, readinq |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error in calling "get_streetAddress" | dgaranz | MapPoint 2006/2009 Discussion | 5 | 06-23-2006 05:03 AM |
| Getting "unspecified error" in VB during FindAddre | mschoonmaker | MapPoint 2006/2009 Discussion | 5 | 06-12-2006 01:11 PM |
| MapPoint OLE error: "Could not update object" | wiecho_k | MapPoint 2006/2009 Discussion | 1 | 07-23-2005 10:53 AM |
| Do I need "Autoroute Europe", if I install "M | bigtail | MapPoint 2006/2009 Discussion | 1 | 03-23-2004 11:58 PM |
| error 16398 with NT service "localsystem" | arsenic77 | MapPoint 2006/2009 Discussion | 3 | 06-19-2003 10:37 AM |