Click here to Skip to main content
15,910,471 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Determining availability of admin privileges Pin
ThatsAlok21-Nov-05 17:23
ThatsAlok21-Nov-05 17:23 
Questioncan't register a dll successfully after a debug build Pin
ewighell18-Nov-05 15:33
ewighell18-Nov-05 15:33 
QuestionAsk for help: about reinterpret_cast Pin
chenxiujie18-Nov-05 14:52
chenxiujie18-Nov-05 14:52 
AnswerRe: Ask for help: about reinterpret_cast Pin
John R. Shaw18-Nov-05 18:33
John R. Shaw18-Nov-05 18:33 
QuestionAsk for help: about singleton class Pin
chenxiujie18-Nov-05 14:50
chenxiujie18-Nov-05 14:50 
AnswerRe: Ask for help: about singleton class Pin
toxcct19-Nov-05 1:14
toxcct19-Nov-05 1:14 
GeneralRe: Ask for help: about singleton class Pin
Bob Stanneveld19-Nov-05 7:12
Bob Stanneveld19-Nov-05 7:12 
AnswerRe: Ask for help: about singleton class Pin
Bob Stanneveld19-Nov-05 7:09
Bob Stanneveld19-Nov-05 7:09 
Hello,

You should make the constructor and destructor private. In general, singletons have one member that gets a pointer to an instance of the singleton class called Instance. If only you looked on google, you would have gotten the answer more early!

//Singleton class
class CSingleton
{
private:
    CSingleton() {} // singleton construcor PRIVATE
    ~CSingleton() {} // singleton destructor PRIVATE

public:
    // For getting a pointer to the one and only instance of CSingleton
    static CSingleton* Instance()
    {
        static CSingleton Singleton;
        return &Singleton;
    }
};



Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]
GeneralRe: Ask for help: about singleton class Pin
chenxiujie19-Nov-05 14:44
chenxiujie19-Nov-05 14:44 
GeneralRe: Ask for help: about singleton class Pin
Bob Stanneveld20-Nov-05 19:11
Bob Stanneveld20-Nov-05 19:11 
Questionrun a console app from MFC or Windows Forms Pin
smargada18-Nov-05 14:46
smargada18-Nov-05 14:46 
AnswerRe: run a console app from MFC or Windows Forms Pin
Gary R. Wheeler20-Nov-05 6:58
Gary R. Wheeler20-Nov-05 6:58 
QuestionMenu Items won't come up gray Pin
BuckBrown18-Nov-05 7:42
BuckBrown18-Nov-05 7:42 
AnswerRe: Menu Items won't come up gray Pin
Maximilien18-Nov-05 7:54
Maximilien18-Nov-05 7:54 
GeneralRe: Menu Items won't come up gray Pin
BuckBrown18-Nov-05 10:24
BuckBrown18-Nov-05 10:24 
QuestionReceiving Msgs from Chat Client Pin
legendaryhwk18-Nov-05 5:40
legendaryhwk18-Nov-05 5:40 
Questionhow can we dial server database from client application Pin
sheerprogrammer18-Nov-05 5:19
sheerprogrammer18-Nov-05 5:19 
QuestionDouble winmains,..kind of... Pin
Karl Josefsson18-Nov-05 5:07
Karl Josefsson18-Nov-05 5:07 
QuestionHow can I set property in edit box to accept only Decimal number Pin
Loc Milkyway18-Nov-05 5:02
Loc Milkyway18-Nov-05 5:02 
AnswerRe: How can I set property in edit box to accept only Decimal number Pin
legendaryhwk18-Nov-05 6:18
legendaryhwk18-Nov-05 6:18 
GeneralRe: How can I set property in edit box to accept only Decimal number Pin
Loc Milkyway18-Nov-05 7:43
Loc Milkyway18-Nov-05 7:43 
AnswerRe: How can I set property in edit box to accept only Decimal number Pin
toxcct18-Nov-05 7:05
toxcct18-Nov-05 7:05 
GeneralRe: How can I set property in edit box to accept only Decimal number Pin
Loc Milkyway18-Nov-05 9:01
Loc Milkyway18-Nov-05 9:01 
GeneralRe: How can I set property in edit box to accept only Decimal number Pin
toxcct18-Nov-05 23:06
toxcct18-Nov-05 23:06 
AnswerRe: How can I set property in edit box to accept only Decimal number Pin
Rick York19-Nov-05 7:49
mveRick York19-Nov-05 7:49 

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.