View Single Post

  #4 (permalink)  
Old 01-11-2005
Wilfried Wilfried is offline
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

Code:
sp.Select();
This is the quilty one When Select is called the while function will be re-entered, again and again until the stack flows over

You have to set a busy flag on entering the function an first check if it is true, if true then exit. When the function exit you set the flag again to false.

Do not put the flag on the stack.

something like this will do:

Code:
            if (!select_change_busy) {
                select_change_busy = true;
                // here the code
                select_change_busy = false;
            }
In the article it was with the mousebutton I think. But it is similar.
Reply With Quote