Hi John.
>the form will close normally right after I rebuild the DBC and I haven't exited the program.
What do you mean by "rebuild the DBC"?
>If I exit the program and restart - the form will no longer close.
So this means the form won't close if you simply run it and don't do anything?
The reason the form won't close is that something has a reference to it, so you have to track that down. For example, do you have an application object that has a reference to the form? If so, you'll need to nuke that reference before the form can close. Here's how I do it:
- The Release method of my base form class calls a custom method called Cleanup.
- Cleanup nulls references to any objects it has references to (so they can be released) and calls an abstract ReleaseMembers method.
- In a particular form, put code in ReleaseMembers to null any object references this form has *and* tell any object that has a reference to this form to release it.
Tracking down references like this can be an ugly chore. Good luck!
Doug
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only