Click here to Skip to main content
15,898,993 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: non-pure virtual function in C++ interface PinPopular
toxcct4-Feb-08 1:57
toxcct4-Feb-08 1:57 
GeneralRe: non-pure virtual function in C++ interface Pin
George_George4-Feb-08 2:01
George_George4-Feb-08 2:01 
GeneralRe: non-pure virtual function in C++ interface Pin
toxcct4-Feb-08 2:09
toxcct4-Feb-08 2:09 
GeneralAddRef and Release Pin
George_George3-Feb-08 15:01
George_George3-Feb-08 15:01 
AnswerRe: AddRef and Release Pin
Lim Bio Liong3-Feb-08 19:15
Lim Bio Liong3-Feb-08 19:15 
GeneralRe: AddRef and Release Pin
George_George3-Feb-08 19:23
George_George3-Feb-08 19:23 
GeneralRe: AddRef and Release Pin
CPallini3-Feb-08 22:39
mveCPallini3-Feb-08 22:39 
GeneralRe: AddRef and Release Pin
George_George3-Feb-08 22:46
George_George3-Feb-08 22:46 
Thanks CPallini,


I have some further thinking. The interface pointers, like pI, pI1, pI2, ... , may be pointed to different instances of object, right?

Here is a sample. Suppose there are 4 object instances of type IX, pointed by pIX1, pIX2, pIX3 and pIX4 repectively. And we have a temporary pointer called pIXTmp. Also suppose at the beginning pIXTmp is NULL;

1. When assigning pIXTmp = pIX1, pIXTmp is pointed to the 1st instance of object;

2. When assigning pIXTmp = pIX2, we need to call Release at first, pIXTmp -> Release() to decrease the reference counter for the 1st object instance, and call pIXTmp -> AddRef() to increase reference conuter to the 2nd object. You can see AddRef and Release are working on different object instance.

Is my understanding correct? Previously, I have not thought of the case when interfaces pointed to different object instances.


regards,
George
GeneralRe: AddRef and Release Pin
CPallini3-Feb-08 22:56
mveCPallini3-Feb-08 22:56 
GeneralRe: AddRef and Release Pin
George_George3-Feb-08 23:04
George_George3-Feb-08 23:04 
GeneralRe: AddRef and Release Pin
CPallini3-Feb-08 23:34
mveCPallini3-Feb-08 23:34 
GeneralRe: AddRef and Release Pin
George_George3-Feb-08 23:50
George_George3-Feb-08 23:50 
GeneralCreateInstance Pin
George_George3-Feb-08 14:52
George_George3-Feb-08 14:52 
QuestionRe: CreateInstance Pin
CPallini3-Feb-08 21:52
mveCPallini3-Feb-08 21:52 
GeneralRe: CreateInstance Pin
George_George3-Feb-08 22:02
George_George3-Feb-08 22:02 
GeneralRe: CreateInstance Pin
CPallini3-Feb-08 22:08
mveCPallini3-Feb-08 22:08 
GeneralRe: CreateInstance Pin
George_George3-Feb-08 22:10
George_George3-Feb-08 22:10 
GeneralRe: CreateInstance Pin
CPallini3-Feb-08 22:19
mveCPallini3-Feb-08 22:19 
GeneralRe: CreateInstance Pin
George_George3-Feb-08 22:25
George_George3-Feb-08 22:25 
GeneralRe: CreateInstance Pin
CPallini3-Feb-08 22:35
mveCPallini3-Feb-08 22:35 
GeneralRe: CreateInstance Pin
George_George3-Feb-08 22:40
George_George3-Feb-08 22:40 
GeneralRe: CreateInstance Pin
CPallini3-Feb-08 22:52
mveCPallini3-Feb-08 22:52 
GeneralRe: CreateInstance Pin
George_George3-Feb-08 23:01
George_George3-Feb-08 23:01 
GeneralRe: CreateInstance Pin
CPallini3-Feb-08 23:33
mveCPallini3-Feb-08 23:33 
GeneralRe: CreateInstance Pin
George_George3-Feb-08 23:53
George_George3-Feb-08 23:53 

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.