04-10-2006 05:48 AM
04-10-2006 08:47 AM - edited 04-10-2006 08:47 AM
Taking a guess, it looks like you may be calling the FileScan callback more than you think.
FileScan has a very large variable declared on the stack (char *p[10000]; ). You do not have anything limiting your callback to handling only EVENT_COMMIT or the event that you want to use this callback. When you call ProcessSystemEvents() any queued events will be allowed to run and you may call FileScan again before it has completed the first call. This would allocate another 10000 pointers on the stack, so I could see where you could get a stack overflow.
A couple of things to try, put if (event==EVENT_COMMIT), or the event you want to use, around the executable part of you code so that it will not be called for any event from the control.
Change the declaration of p to static
static char *p[10000];
By the way, 10000 is a lot of character pointers. If you are going to allocate 10000 strings of 200 char each, that itself is a chunk of memory off the heap, close to 2GB I think (early in the morning, so my math may be faulty)
Message Edited by mvr on 04-10-2006 08:49 AM