Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
AnswerRe: Restrict to create the temp files Pin
I.explore.code10-Oct-07 19:48
I.explore.code10-Oct-07 19:48 
GeneralRe: Restrict to create the temp files Pin
Pankaj Saha10-Oct-07 20:31
Pankaj Saha10-Oct-07 20:31 
Questioncontext menue Pin
Tauseef A10-Oct-07 18:16
Tauseef A10-Oct-07 18:16 
QuestionError in Message Queue Pin
M. J. Jaya Chitra10-Oct-07 18:02
M. J. Jaya Chitra10-Oct-07 18:02 
Question5 objects of that class Pin
dews turner10-Oct-07 17:20
dews turner10-Oct-07 17:20 
AnswerRe: 5 objects of that class Pin
Ravi Bhavnani10-Oct-07 17:36
professionalRavi Bhavnani10-Oct-07 17:36 
GeneralRe: 5 objects of that class Pin
dews turner10-Oct-07 20:45
dews turner10-Oct-07 20:45 
GeneralRe: 5 objects of that class Pin
Malcolm Smart10-Oct-07 21:46
Malcolm Smart10-Oct-07 21:46 
He answered your question. I imagine the fact that he didn't post the code you are not happy.

You want only 5 instances of class A.

Create a factory class AFactory.

The user of your code calls

AFactory.GetNewClassA(). In this class you have a reference coutner, which counts how many instances of Class A have been created. If this counter is less than 5, create and return a new isntance of Class A and incretment the counter. If it is already 5, don't create a new instance.

You can also do this as a static Create method on Class A, using a static reference counter. Google for Factory Pattern.

"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF


"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."

QuestionHow to convert/read c++ code from c#? Pin
zaiyatul hijah10-Oct-07 16:44
zaiyatul hijah10-Oct-07 16:44 
AnswerRe: How to convert/read c++ code from c#? Pin
Paul Conrad12-Oct-07 13:35
professionalPaul Conrad12-Oct-07 13:35 
QuestionI need a file viewr please Pin
hom.rcp10-Oct-07 14:52
hom.rcp10-Oct-07 14:52 
AnswerRe: I need a file viewr please Pin
Christian Graus10-Oct-07 15:31
protectorChristian Graus10-Oct-07 15:31 
GeneralRe: I need a file viewr please Pin
PIEBALDconsult10-Oct-07 15:32
mvePIEBALDconsult10-Oct-07 15:32 
AnswerRe: I need a file viewr please Pin
Matthew Cuba10-Oct-07 15:39
Matthew Cuba10-Oct-07 15:39 
QuestionForm as Command Line Pin
SDEspiritu10-Oct-07 12:06
SDEspiritu10-Oct-07 12:06 
AnswerRe: Form as Command Line Pin
PIEBALDconsult10-Oct-07 13:13
mvePIEBALDconsult10-Oct-07 13:13 
GeneralRe: Form as Command Line Pin
PIEBALDconsult10-Oct-07 13:42
mvePIEBALDconsult10-Oct-07 13:42 
GeneralRe: Form as Command Line Pin
SDEspiritu11-Oct-07 4:48
SDEspiritu11-Oct-07 4:48 
QuestionIIS Configuration Pin
raygn210-Oct-07 11:40
raygn210-Oct-07 11:40 
AnswerRe: IIS Configuration Pin
Yitzchok Dev10-Oct-07 19:50
Yitzchok Dev10-Oct-07 19:50 
QuestionEvents should not return values?! Pin
Domenic Denicola10-Oct-07 11:14
Domenic Denicola10-Oct-07 11:14 
AnswerRe: Events should not return values?! Pin
Christian Graus10-Oct-07 11:25
protectorChristian Graus10-Oct-07 11:25 
GeneralRe: Events should not return values?! Pin
Domenic Denicola10-Oct-07 11:31
Domenic Denicola10-Oct-07 11:31 
GeneralRe: Events should not return values?! Pin
Robert Rohde10-Oct-07 11:44
Robert Rohde10-Oct-07 11:44 
GeneralRe: Events should not return values?! Pin
Domenic Denicola10-Oct-07 11:57
Domenic Denicola10-Oct-07 11:57 

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.