By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,558 Members | 1,699 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,558 IT Pros & Developers. It's quick & easy.

Releasing resources...

P: n/a


I have written print application which prints multiple pages by calling
PrintPage event multiple times.

I am closing all the databases related objects resources when it is not
required.

Since I am new to the printing part of the application just wanted to make
sure what are all the print related object that I should close exclusively
to avoid resource bottle neck (just to make sure the that the resources are
released).

Few objects that I have used in the applications are.

Font, SolidBrush, Pen, StringFormat etc..

Thank you,

Vb.Net and .Net Framework 1.1.

Pete


Feb 14 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Pete,

I don't believe that you would encounter a resource bottleneck under
"normal" conditions and if you are handling
the Font and other objects you mentioned, as expected, there is nothing that
you need to explicitly dispose of.

I assume here that you are using the PrintDocument class to do your
printing, and this is a Windows Application.

2 things to note however,

1. If you're reading the text to print, from a FileStream, then close it and
any attached StreamReaders.

2. When you finish with printing, set the "e.HasMorePages = False", where e
is the PrintPageEventArgs.

Happy Printing.

Regards,

Cerebrus.
=================================
"Pete Smith" <Pe*********@hotmail.com> wrote in message
news:Oq*************@tk2msftngp13.phx.gbl...


I have written print application which prints multiple pages by calling
PrintPage event multiple times.

I am closing all the databases related objects resources when it is not
required.

Since I am new to the printing part of the application just wanted to make
sure what are all the print related object that I should close exclusively
to avoid resource bottle neck (just to make sure the that the resources are released).

Few objects that I have used in the applications are.

Font, SolidBrush, Pen, StringFormat etc..

Thank you,

Vb.Net and .Net Framework 1.1.

Pete

Feb 14 '06 #2

P: n/a
Right or Wrong, I use the rule that if an object has a dispose method, then I
dispose of it when I'm thru with it.
--
Dennis in Houston
"Cerebrus99" wrote:
Hi Pete,

I don't believe that you would encounter a resource bottleneck under
"normal" conditions and if you are handling
the Font and other objects you mentioned, as expected, there is nothing that
you need to explicitly dispose of.

I assume here that you are using the PrintDocument class to do your
printing, and this is a Windows Application.

2 things to note however,

1. If you're reading the text to print, from a FileStream, then close it and
any attached StreamReaders.

2. When you finish with printing, set the "e.HasMorePages = False", where e
is the PrintPageEventArgs.

Happy Printing.

Regards,

Cerebrus.
=================================
"Pete Smith" <Pe*********@hotmail.com> wrote in message
news:Oq*************@tk2msftngp13.phx.gbl...


I have written print application which prints multiple pages by calling
PrintPage event multiple times.

I am closing all the databases related objects resources when it is not
required.

Since I am new to the printing part of the application just wanted to make
sure what are all the print related object that I should close exclusively
to avoid resource bottle neck (just to make sure the that the resources

are
released).

Few objects that I have used in the applications are.

Font, SolidBrush, Pen, StringFormat etc..

Thank you,

Vb.Net and .Net Framework 1.1.

Pete


Feb 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.