E
eBob.com
I have a user control which creates an Excel spread sheet and badly needs
Dispose/Finalize. I've read up on the subject in Balena and I think I
understand what is going on. But the VS generated coded confuses me a bit.
VS generates a Dispose subroutine, but it's not obvious if it is ok to
modify it. In the New subroutine VS makes clear that you can add code to it
and tell you where to add it ("Add any initialization after the
InitializeComponent() call"). But there is no such direction in the
generated Dispose subroutine.
VS does not generate a Finalize subroutine. That confuses me. Shouldn't
all controls have a Finalize method. If I code a Finalize method (which I
should, right?) then I should also create a static "disposed"variable,
right? That seems like the thing to do but on the other hand VS did not
generate one.
I'll be grateful if you can help me with these areas of confusion.
Bob
Dispose/Finalize. I've read up on the subject in Balena and I think I
understand what is going on. But the VS generated coded confuses me a bit.
VS generates a Dispose subroutine, but it's not obvious if it is ok to
modify it. In the New subroutine VS makes clear that you can add code to it
and tell you where to add it ("Add any initialization after the
InitializeComponent() call"). But there is no such direction in the
generated Dispose subroutine.
VS does not generate a Finalize subroutine. That confuses me. Shouldn't
all controls have a Finalize method. If I code a Finalize method (which I
should, right?) then I should also create a static "disposed"variable,
right? That seems like the thing to do but on the other hand VS did not
generate one.
I'll be grateful if you can help me with these areas of confusion.
Bob