468,107 Members | 1,470 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

Correct use of dispose

Hi,
I have a class with a handle to a window and a handle to its icon (if
it has one).

What do i need to do to correctly free these resources when my class is
disposed?

Cheers,
James.

Jan 22 '07 #1
2 1254
James,

See "Implementing a Dispose Method" in MSDN.

http://msdn2.microsoft.com/en-us/library/fs2xkftw.aspx

Brian

pigeonrandle wrote:
Hi,
I have a class with a handle to a window and a handle to its icon (if
it has one).

What do i need to do to correctly free these resources when my class is
disposed?

Cheers,
James.
Jan 22 '07 #2
That'll clean itself up, you dont need to do anything.

you only need to put code in dispose to free up external resources used by
the form or class.

"pigeonrandle" <pi**********@hotmail.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
Hi,
I have a class with a handle to a window and a handle to its icon (if
it has one).

What do i need to do to correctly free these resources when my class is
disposed?

Cheers,
James.

Jan 22 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by kjon | last post: by
6 posts views Thread by Rob Meade | last post: by
3 posts views Thread by Chris | last post: by
7 posts views Thread by garyusenet | last post: by
2 posts views Thread by Rob Meade | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.