Click here to Skip to main content
15,902,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Software failing when distributed Pin
zhang80060520-May-07 21:57
zhang80060520-May-07 21:57 
GeneralRe: Software failing when distributed Pin
Stick^20-May-07 23:37
Stick^20-May-07 23:37 
QuestionHow to restrict the number of Objects created ?? Pin
narayanagvs20-May-07 17:58
narayanagvs20-May-07 17:58 
AnswerRe: How to restrict the number of Objects created ?? Pin
cp987620-May-07 18:15
cp987620-May-07 18:15 
GeneralRe: How to restrict the number of Objects created ?? Pin
led mike20-May-07 19:19
led mike20-May-07 19:19 
GeneralRe: How to restrict the number of Objects created ?? Pin
cp987620-May-07 19:42
cp987620-May-07 19:42 
AnswerRe: How to restrict the number of Objects created ?? Pin
led mike20-May-07 19:19
led mike20-May-07 19:19 
AnswerRe: How to restrict the number of Objects created ?? Pin
Ravi Bhavnani20-May-07 20:22
professionalRavi Bhavnani20-May-07 20:22 
narayanagvs wrote:
How to restrict the number of objects created for a class??
  1. Make the constructor private.
  2. Add a static factory method (eg: CreateInstance()) to the class. The method should count the number of instances served up and use this value to control the behavior of the CreateInstance() method.
  3. In the object's destructor, decrement the instance count (held as a static member).
/ravi

This is your brain on Celcius
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com

AnswerRe: How to restrict the number of Objects created ?? Pin
CPallini20-May-07 20:48
mveCPallini20-May-07 20:48 
QuestionScrollbar problem Pin
Aint20-May-07 17:51
Aint20-May-07 17:51 
AnswerRe: Scrollbar problem Pin
Nelek20-May-07 20:50
protectorNelek20-May-07 20:50 
GeneralRe: Scrollbar problem Pin
Aint20-May-07 22:02
Aint20-May-07 22:02 
QuestionCString to const *char or clr Pin
Star0920-May-07 16:49
Star0920-May-07 16:49 
AnswerRe: CString to const *char or clr Pin
Christian Graus20-May-07 18:37
protectorChristian Graus20-May-07 18:37 
AnswerRe: CString to const *char or clr Pin
Manoj Kumar Rai20-May-07 20:17
professionalManoj Kumar Rai20-May-07 20:17 
AnswerRe: CString to const *char or clr Pin
prasad_som20-May-07 20:23
prasad_som20-May-07 20:23 
AnswerRe: CString to const *char or clr Pin
prasad_som20-May-07 20:20
prasad_som20-May-07 20:20 
QuestionCustom Caption in XP Pin
maxus9920-May-07 15:53
maxus9920-May-07 15:53 
AnswerRe: Custom Caption in XP Pin
Hamid_RT20-May-07 18:48
Hamid_RT20-May-07 18:48 
GeneralRe: Custom Caption in XP Pin
maxus9921-May-07 3:19
maxus9921-May-07 3:19 
QuestionSQL transaction rollback problem Pin
Moonis Ahmed20-May-07 15:12
Moonis Ahmed20-May-07 15:12 
AnswerRe: SQL transaction rollback problem Pin
zhang80060520-May-07 19:37
zhang80060520-May-07 19:37 
GeneralRe: SQL transaction rollback problem Pin
Moonis Ahmed20-May-07 19:50
Moonis Ahmed20-May-07 19:50 
GeneralRe: SQL transaction rollback problem Pin
Moonis Ahmed22-May-07 22:55
Moonis Ahmed22-May-07 22:55 
Questiondirect3d in layered wnd Pin
johny_d20-May-07 10:26
johny_d20-May-07 10:26 

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.