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
Results 1 to 6 of 6

Error "overflow execution stack" while readinq a

This is a discussion on Error "overflow execution stack" while readinq a within the MapPoint Desktop 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 ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Error "overflow execution stack" while readinq a

    Hi,

    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
    When I read about 2000 records I have an overflow execution stack error in my application. ( I have about 8000 Pushpins in my map )

    Thanks for your help

    Mohamed
    from CasaBlanca

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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
    Does this means you display a messagebox or another form from within the loop ? If this is the case then that could be the reason of a stack overflow, because executing a modal form will enter the message pump and your procedure could be reentered !

    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?

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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 &#40;n < 8000&#41; &#123;
                    MP.ActiveMap.AddPushpin&#40;Loc, n.ToString&#40;&#41;&#41;;
                    n++;
                &#125;
                n = 0;
                object o = "My Pushpins";
                MapPoint.DataSet ds = MP.ActiveMap.DataSets.get_Item&#40;ref o&#41;;
                Recordset rs = ds.QueryAllRecords&#40;&#41;;
                rs.MoveFirst&#40;&#41;;
                while &#40;!rs.EOF&#41; &#123;
                    Console.WriteLine&#40;rs.Pushpin.Name.ToString&#40;&#41;&#41;;
                    rs.MoveNext&#40;&#41;;
                &#125;
    Stack overflow must be somewhere in your application. Can you do a stack trace in VB ? If you can (I really dont know) you can see the callers and see who is overflowing the stack.

    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.

  5. #5
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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&#40;50, 4, 1&#41;
    TANTQUE n < 8000
    	n++
    	Trace&#40;n&#41;
    	ObjMap>>AddPushpin&#40;ObjLoc, NumériqueVersChaine&#40;n&#41;&#41;;
    FIN
    
    ObjRecords  = ObjMap>>DataSets>>item&#40;1&#41;>>Queryallrecords
    
    nbrecords = ObjRecords>>Parent>>RecordCount
    
    Info&#40;nbrecords&#41;
    num = 0
    
    ObjRecords>>MoveFirst	
    
    TANTQUE  ObjRecords>>EOF = Faux   
    
    	num++
    	ObjPin =  ObjRecords>>PushPin
    	cMagasin = Majuscule&#40;ObjPin>>Name&#41;
        // Here error when Num = 4312
    	Trace&#40;num,cMagasin&#41;
    
      ObjRecords>>MoveNext
    FIN
    The error is :

    "Votre code a provoqué un dépassement de la pile"


    Thanks again for your help.

    Mohamed

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Getting "unspecified error" in VB during FindAddre
    By mschoonmaker in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 07-24-2010, 04:49 PM
  2. Error in calling "get_streetAddress"
    By dgaranz in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 06-23-2006, 06:03 AM
  3. MapPoint OLE error: "Could not update object"
    By wiecho_k in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-23-2005, 11:53 AM
  4. Do I need "Autoroute Europe", if I install "M
    By bigtail in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-24-2004, 12:58 AM
  5. error 16398 with NT service "localsystem"
    By arsenic77 in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 06-19-2003, 11:37 AM

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 26 27 28 29 30 31 32 33 34 35 36