Ok guys, I really need help. I wrote quite a big source that does not work.
Nothing special bout that, but this error seems to kill me:

I want to populate one listbox with sub-folders, another one with the files from a specific path. This happens each time the user clicks a button (DIR UP). Then the procedure "PopulateBrowseLists" is called.

In some special cases (after one successful run) it gives me this error:
Instruction at 0x77d603be referenced memory at "0x007e9d64". The memory could not be "read".

But if I take the PopulateBrowseLists - call and make a simple messagebox-call before it, everything works fine, each run.
When I enter the debugger it gives me code that seems to be not part of my project as the given rva does not lie in my sections.
And as I know what I write, this code is not my code. Is this an error during API or what?

I tried to trace the error down within the source but I can't find it. It seems to happen at this point:

LoadElements:
....
invoke FindNextFile....
cmp eax, 0h
jne LoadElements


before the last two lines the program runs. But all popups and msgboxes that I insert after the last line do never reach my desktop.

Please help, suggestions are welcomed.
Dominik
Dominik
Posted on 2004-10-27 15:53:48 by Dom
Could it be getting caught in an infinite loop? If so, ensure the exist conditions can be satisfied.
Posted on 2004-10-27 16:04:44 by bitRAKE
No, FindNextFile is looped until it quits. It somehow comes with another thread I think...When a thread (HandleSocket) is executed, the error comes up. Else, the whole PopulateBrowseLists -Thing works fine.
How can it get changed by a thread?
Posted on 2004-10-27 16:49:07 by Dom
That sounds strange, hmm...threads are executed in the same address space but have their own stack and registers. So, it would seem there is a bad pointer in the thread - if that is the source of the problem.

How do you know the loop exits if the code after it does not run?
Posted on 2004-10-27 17:23:13 by bitRAKE
wohh..i found the error: I used two functions for the threads, but (don't know why) I disabled the first parameter:
ThreadProc ;p1:DWORD

Therefore each thread that finished should lead to an error. These errors are hard to find as you can never know where they show up. thx, Bitrake
Dominik
Posted on 2004-10-27 17:28:59 by Dom