Click here to Skip to main content
15,921,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General.pdf to .txt conversion Pin
Chintan3-Sep-03 0:35
Chintan3-Sep-03 0:35 
GeneralRe: .pdf to .txt conversion Pin
David Crow3-Sep-03 2:47
David Crow3-Sep-03 2:47 
GeneralC++ related issue Pin
Jamal Jamshed3-Sep-03 0:29
sussJamal Jamshed3-Sep-03 0:29 
GeneralRe: C++ related issue Pin
dog_spawn3-Sep-03 1:56
dog_spawn3-Sep-03 1:56 
GeneralRe: C++ related issue Pin
Jamal Jamshed3-Sep-03 2:23
sussJamal Jamshed3-Sep-03 2:23 
GeneralRe: C++ related issue Pin
David Crow3-Sep-03 2:49
David Crow3-Sep-03 2:49 
GeneralRe: C++ related issue Pin
Scott H. Settlemier3-Sep-03 10:22
Scott H. Settlemier3-Sep-03 10:22 
GeneralRe: C++ related issue Pin
John R. Shaw3-Sep-03 6:47
John R. Shaw3-Sep-03 6:47 
1) Create a base class that all related classes are derived from.
2) Make any member variables that you wish to be common to all derived classes static members.
3) If you are going to destroy (free) any of the members in the destuctor then you need to add a static reference counter member variable that is incremented in the constructor and decremented in the destructor.

// In header
class MyClass
{
    static int m_nRefCount;
    static int m_nMem1;
    static whatever* m_pWhatEver;
...................
public: // constructors / destructors / accessors / manipulators / ect...
...................
};

// In module / code file

int MyClass::m_nRefCount = 0;
whatever MyClass::m_pWhatEver = NULL;

MyClass::MyClass()
{
    ++m_nRefCount;
}

MyClass::~MyClass()
{
    if( --m_nRefCount < 1 )
    {
        if( m_pWhatEver is valid )
            delete m_pWhatEver;
    }
}


:-DHave a wonderful day.

INTP
General_crtBreakAlloc Pin
Bernhard2-Sep-03 23:22
Bernhard2-Sep-03 23:22 
Questioninsert for each Combo Box index a variable edit control? Pin
Member 3971372-Sep-03 22:12
Member 3971372-Sep-03 22:12 
Generalthe problem of SEH Pin
crazyzhou2-Sep-03 21:18
crazyzhou2-Sep-03 21:18 
GeneralRe: the problem of SEH Pin
Brad Sokol3-Sep-03 3:04
Brad Sokol3-Sep-03 3:04 
GeneralRe: the problem of SEH Pin
crazyzhou3-Sep-03 19:14
crazyzhou3-Sep-03 19:14 
GeneralRe: the problem of SEH Pin
Brad Sokol4-Sep-03 2:47
Brad Sokol4-Sep-03 2:47 
Generalwhen i install ms SDK.... Pin
Anonymous2-Sep-03 21:02
Anonymous2-Sep-03 21:02 
GeneralRe: when i install ms SDK.... Pin
John R. Shaw3-Sep-03 6:21
John R. Shaw3-Sep-03 6:21 
GeneralGet the size of RTF text on a print DC Pin
CodeBrain2-Sep-03 20:41
CodeBrain2-Sep-03 20:41 
GeneralRe: Get the size of RTF text on a print DC Pin
eco2-Sep-03 21:09
eco2-Sep-03 21:09 
GeneralRe: Get the size of RTF text on a print DC Pin
eco2-Sep-03 21:12
eco2-Sep-03 21:12 
GeneralRe: Get the size of RTF text on a print DC Pin
CodeBrain3-Sep-03 3:21
CodeBrain3-Sep-03 3:21 
QuestionUnicode issue? How to resolve? Pin
Yu Zhiquan2-Sep-03 20:15
Yu Zhiquan2-Sep-03 20:15 
GeneralMFC Gurus Only1 Pin
John R. Shaw2-Sep-03 19:24
John R. Shaw2-Sep-03 19:24 
GeneralRe: MFC Gurus Only1 Pin
Joey Bloggs2-Sep-03 20:22
Joey Bloggs2-Sep-03 20:22 
GeneralRe: MFC Gurus Only1 Pin
John R. Shaw3-Sep-03 6:14
John R. Shaw3-Sep-03 6:14 
GeneralRe: MFC Gurus Only1 Pin
John R. Shaw3-Sep-03 8:20
John R. Shaw3-Sep-03 8:20 

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.