PC Review


Reply
Thread Tools Rate Thread

Correct use of dispose

 
 
pigeonrandle
Guest
Posts: n/a
 
      22nd Jan 2007
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.

 
Reply With Quote
 
 
 
 
Daniel
Guest
Posts: n/a
 
      22nd Jan 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Brian Gideon
Guest
Posts: n/a
 
      22nd Jan 2007
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does DataGridView.Dispose Call DataGridViewRow.Dispose? eBob.com Microsoft VB .NET 13 31st Jul 2009 02:08 PM
Form.Dispose does not invoke InputPanel.Dispose tomj@softhome.net Microsoft Dot NET Compact Framework 3 24th Jan 2006 03:28 PM
the difference betweenSqlConnection.IDisposable.Dispose() andSqlConnection.Dispose(). tangyong Microsoft Dot NET Framework 1 20th Jan 2006 04:53 AM
Correct handling of Connection.Dispose() and Close() _DG Microsoft ADO .NET 1 9th Nov 2005 11:07 AM
Correct way of using Dispose kjon Microsoft Dot NET 9 23rd Jun 2004 07:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:30 PM.