Click here to Skip to main content
16,004,890 members
Home / Discussions / C#
   

C#

 
Generalreturning strings from c to c# Pin
long_il7-Apr-08 4:47
long_il7-Apr-08 4:47 
GeneralRe: returning strings from c to c# Pin
led mike7-Apr-08 4:49
led mike7-Apr-08 4:49 
GeneralRe: returning strings from c to c# Pin
Luc Pattyn7-Apr-08 5:53
sitebuilderLuc Pattyn7-Apr-08 5:53 
GeneralRe: returning strings from c to c# Pin
half-life7-Apr-08 7:43
half-life7-Apr-08 7:43 
GeneralRe: returning strings from c to c# Pin
Luc Pattyn7-Apr-08 8:06
sitebuilderLuc Pattyn7-Apr-08 8:06 
GeneralRe: returning strings from c to c# Pin
half-life7-Apr-08 8:13
half-life7-Apr-08 8:13 
QuestionShould I always call the Disposal() method of a object after using it? Pin
Secret_Garden7-Apr-08 4:10
Secret_Garden7-Apr-08 4:10 
GeneralRe: Should I always call the Disposal() method of a object after using it? Pin
Pete O'Hanlon7-Apr-08 4:18
mvePete O'Hanlon7-Apr-08 4:18 
Well, you don't have to call it after you finish with the object. That is if you don't mind unmanaged resources being left unfreed. In most cases, the Dispose method is there for your application to tell the underlying code to dispose of unmanaged resources - there are exceptions where people are doing odd behaviour in the Dispose (such as closing a database connection - odd yes, but I have seen it), but it is good practice to Dispose of resources when you've finished with them.

In your example, you can do
using (Pen pen = new Pen)
{
}
and the Dispose method is automatically called for you because the using (){} essentially converts into a try/finally block where the finally calls the Dispose method.


Deja View - the feeling that you've seen this post before.

My blog | My articles



GeneralRe: Should I always call the Disposal() method of a object after using it? Pin
Mike Dimmick7-Apr-08 4:23
Mike Dimmick7-Apr-08 4:23 
GeneralRe: Should I always call the Disposal() method of a object after using it? Pin
Secret_Garden7-Apr-08 4:37
Secret_Garden7-Apr-08 4:37 
Generalexcel Pin
ellllllllie7-Apr-08 3:50
ellllllllie7-Apr-08 3:50 
GeneralStrang Error :( Pin
M Riaz Bashir7-Apr-08 3:41
M Riaz Bashir7-Apr-08 3:41 
GeneralRe: Strang Error :( Pin
Mike Dimmick7-Apr-08 4:28
Mike Dimmick7-Apr-08 4:28 
GeneralRe: Strang Error :( Pin
Luc Pattyn7-Apr-08 4:36
sitebuilderLuc Pattyn7-Apr-08 4:36 
GeneralRe: Strang Error :( Pin
M Riaz Bashir7-Apr-08 4:56
M Riaz Bashir7-Apr-08 4:56 
General[Message Deleted] Pin
M Riaz Bashir7-Apr-08 4:58
M Riaz Bashir7-Apr-08 4:58 
GeneralRe: Here is my codes Pin
Luc Pattyn7-Apr-08 5:43
sitebuilderLuc Pattyn7-Apr-08 5:43 
GeneralRe: Here is my codes Pin
M Riaz Bashir7-Apr-08 5:46
M Riaz Bashir7-Apr-08 5:46 
GeneralEvent handler for menu populated from database Pin
random47-Apr-08 3:32
random47-Apr-08 3:32 
GeneralRe: Event handler for menu populated from database Pin
Mark J. Miller7-Apr-08 6:07
Mark J. Miller7-Apr-08 6:07 
GeneralRe: Event handler for menu populated from database Pin
random421-Apr-08 18:36
random421-Apr-08 18:36 
GeneralRe: Event handler for menu populated from database Pin
lsconyer7-Apr-08 6:51
lsconyer7-Apr-08 6:51 
Questionhow to access browser elements Pin
Senthil Palani7-Apr-08 3:06
Senthil Palani7-Apr-08 3:06 
QuestionFloating/Dockable form Pin
Noemi Katinka7-Apr-08 2:52
Noemi Katinka7-Apr-08 2:52 
GeneralRe: Floating/Dockable form Pin
lsconyer7-Apr-08 3:11
lsconyer7-Apr-08 3:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.