Click here to Skip to main content
15,899,314 members
Home / Discussions / C#
   

C#

 
AnswerRe: local method variable or global class ? Pin
Enishi20-Apr-05 1:37
Enishi20-Apr-05 1:37 
GeneralRe: local method variable or global class ? Pin
CiNN20-Apr-05 2:02
CiNN20-Apr-05 2:02 
AnswerRe: local method variable or global class ? Pin
S. Senthil Kumar20-Apr-05 2:09
S. Senthil Kumar20-Apr-05 2:09 
GeneralRe: local method variable or global class ? Pin
Sebastian Schneider20-Apr-05 3:50
Sebastian Schneider20-Apr-05 3:50 
GeneralRe: local method variable or global class ? Pin
S. Senthil Kumar20-Apr-05 4:33
S. Senthil Kumar20-Apr-05 4:33 
GeneralRe: local method variable or global class ? Pin
Dave Kreskowiak20-Apr-05 5:52
mveDave Kreskowiak20-Apr-05 5:52 
GeneralRe: local method variable or global class ? Pin
S. Senthil Kumar20-Apr-05 6:04
S. Senthil Kumar20-Apr-05 6:04 
GeneralRe: local method variable or global class ? Pin
Dave Kreskowiak20-Apr-05 14:25
mveDave Kreskowiak20-Apr-05 14:25 
The cost of allocating those resources is negligable. You're not gaining that much of a perfomance benefit by caching it. Also, if you cache the handle, then change the screen resolution or color depth, the handle is no longer valid for drawing.

No, just caching a few handles will not run the system out of resources. But it requires you to keep track of them for the duration of the application session. Just about everything in Windows has a handle attached to it, some even use thousands at a time. The performance benefit is just not worth the extra overhead of caching them.

Allocate it, use it, free it... Would you open a database connection and hang onto it for the duration of your app?



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: local method variable or global class ? Pin
S. Senthil Kumar20-Apr-05 19:07
S. Senthil Kumar20-Apr-05 19:07 
GeneralRe: local method variable or global class ? Pin
Dave Kreskowiak21-Apr-05 2:19
mveDave Kreskowiak21-Apr-05 2:19 
GeneralRe: local method variable or global class ? Pin
S. Senthil Kumar21-Apr-05 4:59
S. Senthil Kumar21-Apr-05 4:59 
GeneralRe: local method variable or global class ? Pin
Dave Kreskowiak21-Apr-05 12:06
mveDave Kreskowiak21-Apr-05 12:06 
Generalaudio recording Pin
_g00fy_20-Apr-05 1:18
suss_g00fy_20-Apr-05 1:18 
GeneralWindows Services in Foreground Pin
Enishi20-Apr-05 1:18
Enishi20-Apr-05 1:18 
GeneralReports in C# Pin
Ana-Gabriela Clem19-Apr-05 23:20
Ana-Gabriela Clem19-Apr-05 23:20 
Generalpermissions help! Pin
Anthony Mushrow19-Apr-05 23:14
professionalAnthony Mushrow19-Apr-05 23:14 
GeneralRe: permissions help! Pin
Dave Kreskowiak20-Apr-05 5:45
mveDave Kreskowiak20-Apr-05 5:45 
GeneralBlocking Pakets on Network Pin
Member 1226917219-Apr-05 21:38
Member 1226917219-Apr-05 21:38 
GeneralRe: Blocking Pakets on Network Pin
Dave Kreskowiak20-Apr-05 5:40
mveDave Kreskowiak20-Apr-05 5:40 
QuestionIs there something faster than .|[\r\n] in RegExp ? Pin
ektoras19-Apr-05 21:26
ektoras19-Apr-05 21:26 
AnswerRe: Is there something faster than .|[\r\n] in RegExp ? Pin
DavidNohejl19-Apr-05 23:59
DavidNohejl19-Apr-05 23:59 
AnswerRe: Is there something faster than .|[\r\n] in RegExp ? Pin
leppie20-Apr-05 4:33
leppie20-Apr-05 4:33 
GeneralRe: Is there something faster than .|[\r\n] in RegExp ? Pin
ektoras21-Apr-05 6:04
ektoras21-Apr-05 6:04 
GeneralRe: Is there something faster than .|[\r\n] in RegExp ? Pin
leppie21-Apr-05 6:42
leppie21-Apr-05 6:42 
GeneralRe: Is there something faster than .|[\r\n] in RegExp ? Pin
ektoras21-Apr-05 9:52
ektoras21-Apr-05 9:52 

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.