George, Fred, et al:
>>Kenneth is correct, ANY local variable reference to one of the TreeView node properties (FirstSibling, Next, etc.) cause the
problem. At the very least you get the "hanging" form that can not be closed, just like a dangling object reference. No amount of
NULLing, RELEASEing the variable helps. Sometime the form hangs, sometime you get the C....5 problem.<<
>>
>>PS:
>>I had posted a thread on this quite a few months ago...
I'm glad at least that I have ended up rediscovering something that someone else knew. Hopefully this will get MS to pay particular attention to this discrete and easily reproducible problem.
FWIW, I did go slightly crazy looking for my accidental public or private node pointer, and only after I had triple-checked the code did I come to the thought that the node pointers were "hanging" somehow. The clue was in the fact that the forms would not release.
Happily, though, you can pass a node pointer as a local parameter, and so long as you do not reassign it a la LoNode = LoNode.Next, you can still use node pointers, and it does work very nicely if you know about this "gotcha." The form is now doing exactly what I wanted.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement