Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to add Button to Child Window ? Pin
tina->newcoder11-Feb-08 6:12
tina->newcoder11-Feb-08 6:12 
GeneralRe: How to add Button to Child Window ? Pin
tina->newcoder11-Feb-08 5:42
tina->newcoder11-Feb-08 5:42 
QuestionRe: How to add Button to Child Window ? Pin
David Crow11-Feb-08 5:47
David Crow11-Feb-08 5:47 
GeneralRe: How to add Button to Child Window ? Pin
tina->newcoder11-Feb-08 6:28
tina->newcoder11-Feb-08 6:28 
QuestionRe: How to add Button to Child Window ? Pin
David Crow11-Feb-08 6:38
David Crow11-Feb-08 6:38 
GeneralRe: How to add Button to Child Window ? Pin
tina->newcoder11-Feb-08 6:49
tina->newcoder11-Feb-08 6:49 
GeneralDllMain implementation Pin
George_George9-Feb-08 23:01
George_George9-Feb-08 23:01 
Generalsmart pointer release Pin
George_George9-Feb-08 22:48
George_George9-Feb-08 22:48 
Hello everyone,


About the release method implementation of smart pointer of COM, there are two approaches below, and approach 1 is preferred is recommended by Inside COM -- should be better.

Anyone know why approach 1 is better than approach 2?

(m_pI is interface pointer to a COM interface of type T, and it is a member variable of the COM smart pointer class)

Approach 1:

void Release()
{
    if (m_pI != NULL)
    {
        T* pOld = m_pI;
        m_pI = NULL;
        pOld->Release();
    }
}


Approach 2:

void Release()
{
    if (m_pI != NULL)
    {
        m_pI -> Release();
        m_pI = NULL;
    }
}



thanks in advance,
George
JokeRe: The Only Way to Approach Smart ... Pin
Chris Meech10-Feb-08 13:02
Chris Meech10-Feb-08 13:02 
GeneralRe: The Only Way to Approach Smart ... Pin
George_George10-Feb-08 19:21
George_George10-Feb-08 19:21 
Questioncan anybody help Pin
philiptabraham9-Feb-08 21:51
philiptabraham9-Feb-08 21:51 
AnswerRe: can anybody help Pin
Mark Salsbery10-Feb-08 9:51
Mark Salsbery10-Feb-08 9:51 
AnswerRe: can anybody help Pin
Rajesh R Subramanian10-Feb-08 19:08
professionalRajesh R Subramanian10-Feb-08 19:08 
AnswerRe: can anybody help Pin
Hamid_RT10-Feb-08 20:44
Hamid_RT10-Feb-08 20:44 
Generalc++ to matlab Pin
ashwiny9-Feb-08 17:42
ashwiny9-Feb-08 17:42 
GeneralRe: c++ to matlab Pin
jeron110-Feb-08 5:07
jeron110-Feb-08 5:07 
QuestionRe: c++ to matlab Pin
Mark Salsbery10-Feb-08 9:52
Mark Salsbery10-Feb-08 9:52 
Questionstring to LRESULT Pin
Zerox MXI9-Feb-08 17:08
Zerox MXI9-Feb-08 17:08 
GeneralRe: string to LRESULT Pin
Stephen Hewitt9-Feb-08 17:34
Stephen Hewitt9-Feb-08 17:34 
GeneralRe: string to LRESULT Pin
Zerox MXI9-Feb-08 17:38
Zerox MXI9-Feb-08 17:38 
GeneralRe: string to LRESULT Pin
Stephen Hewitt9-Feb-08 17:48
Stephen Hewitt9-Feb-08 17:48 
GeneralRe: string to LRESULT Pin
Zerox MXI9-Feb-08 17:57
Zerox MXI9-Feb-08 17:57 
GeneralRe: string to LRESULT Pin
Hamid_RT10-Feb-08 20:51
Hamid_RT10-Feb-08 20:51 
GeneralNetworking via Internet in C++ Pin
Michael Fritzius9-Feb-08 13:01
professionalMichael Fritzius9-Feb-08 13:01 
GeneralRe: Networking via Internet in C++ Pin
Garth J Lancaster9-Feb-08 19:20
professionalGarth J Lancaster9-Feb-08 19: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.