Click here to Skip to main content
16,006,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIs there any help for ActiveX controls with vc6.0? Pin
followait6-Dec-05 20:37
followait6-Dec-05 20:37 
QuestionCan I restrict a class not to have more than 2 objects? Pin
G Haranadh6-Dec-05 20:28
G Haranadh6-Dec-05 20:28 
AnswerRe: Can I restrict a class not to have more than 2 objects? Pin
sunit56-Dec-05 20:52
sunit56-Dec-05 20:52 
GeneralRe: Can I restrict a class not to have more than 2 objects? Pin
G Haranadh6-Dec-05 21:01
G Haranadh6-Dec-05 21:01 
GeneralRe: Can I restrict a class not to have more than 2 objects? Pin
sunit56-Dec-05 21:09
sunit56-Dec-05 21:09 
GeneralRe: Can I restrict a class not to have more than 2 objects? Pin
Cedric Moonen6-Dec-05 21:16
Cedric Moonen6-Dec-05 21:16 
GeneralRe: Can I restrict a class not to have more than 2 objects? Pin
Cedric Moonen6-Dec-05 21:19
Cedric Moonen6-Dec-05 21:19 
GeneralRe: Can I restrict a class not to have more than 2 objects? Pin
ThatsAlok6-Dec-05 21:50
ThatsAlok6-Dec-05 21:50 
sunit5 wrote:
ForumVisual C++
Subject:Re: Can I restrict a class not to have more than 2 objects?
Sender:sunit5
Date:2:52 7 Dec '05

static CMyClass ::Counter=0;

initilaize a static member to zero;
// class constructor
CMyClass()
{
CMyClass ::counter++;

if(CMyClass ::Counter>2)
{
// call the destructor
this->~CMyClass()
return;
}


Hello Sir, AFAIK is know Explicit call to the Destructor is not good programming Practice.


"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow


cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
GeneralRe: Can I restrict a class not to have more than 2 objects? Pin
ThatsAlok6-Dec-05 22:10
ThatsAlok6-Dec-05 22:10 
AnswerRe: Can I restrict a class not to have more than 2 objects? Pin
Cedric Moonen6-Dec-05 21:14
Cedric Moonen6-Dec-05 21:14 
GeneralRe: Can I restrict a class not to have more than 2 objects? Pin
Bob Stanneveld6-Dec-05 22:33
Bob Stanneveld6-Dec-05 22:33 
GeneralRe: Can I restrict a class not to have more than 2 objects? Pin
toxcct6-Dec-05 22:50
toxcct6-Dec-05 22:50 
GeneralRe: Can I restrict a class not to have more than 2 objects? Pin
G Haranadh6-Dec-05 22:56
G Haranadh6-Dec-05 22:56 
QuestionRe: Can I restrict a class not to have more than 2 objects? Pin
David Crow7-Dec-05 3:08
David Crow7-Dec-05 3:08 
QuestionAlphaBlend + TextBox = crash?? Pin
dy136-Dec-05 20:24
dy136-Dec-05 20:24 
QuestionUrgent : About SHGetValue() API used for Registry Pin
Supriya Tonape6-Dec-05 20:03
Supriya Tonape6-Dec-05 20:03 
AnswerRe: Urgent : About SHGetValue() API used for Registry Pin
kakan6-Dec-05 20:18
professionalkakan6-Dec-05 20:18 
GeneralRe: Urgent : About SHGetValue() API used for Registry Pin
Supriya Tonape6-Dec-05 21:39
Supriya Tonape6-Dec-05 21:39 
GeneralRe: Urgent : About SHGetValue() API used for Registry Pin
kakan7-Dec-05 0:34
professionalkakan7-Dec-05 0:34 
GeneralRe: Urgent : About SHGetValue() API used for Registry Pin
Supriya Tonape7-Dec-05 1:06
Supriya Tonape7-Dec-05 1:06 
QuestionChanging Font Size in MS Word Automated Document Created using VC++(MFC) Pin
Sachinpatole6-Dec-05 19:56
Sachinpatole6-Dec-05 19:56 
QuestionThanks for help and need further..... Pin
usha_dolly6-Dec-05 19:35
usha_dolly6-Dec-05 19:35 
AnswerRe: Thanks for help and need further..... Pin
ThatsAlok6-Dec-05 21:55
ThatsAlok6-Dec-05 21:55 
QuestionPlease HELP Me( Porting from Win32 to MAC) Pin
vishix16-Dec-05 19:31
vishix16-Dec-05 19:31 
QuestionLittle Question Pin
Ankush Mehta6-Dec-05 19:08
Ankush Mehta6-Dec-05 19:08 

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.