Click here to Skip to main content
15,915,857 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: non-pure virtual function in C++ interface Pin
Stephen Hewitt7-Feb-08 16:04
Stephen Hewitt7-Feb-08 16:04 
GeneralRe: non-pure virtual function in C++ interface Pin
George_George7-Feb-08 21:03
George_George7-Feb-08 21:03 
GeneralRe: non-pure virtual function in C++ interface Pin
Rajkumar R3-Feb-08 19:20
Rajkumar R3-Feb-08 19:20 
GeneralRe: non-pure virtual function in C++ interface Pin
George_George3-Feb-08 19:26
George_George3-Feb-08 19:26 
GeneralRe: non-pure virtual function in C++ interface Pin
Stephen Hewitt3-Feb-08 19:29
Stephen Hewitt3-Feb-08 19:29 
GeneralRe: non-pure virtual function in C++ interface Pin
George_George3-Feb-08 19:38
George_George3-Feb-08 19:38 
GeneralRe: non-pure virtual function in C++ interface Pin
Stephen Hewitt5-Feb-08 11:49
Stephen Hewitt5-Feb-08 11:49 
AnswerRe: non-pure virtual function in C++ interface Pin
Rajkumar R3-Feb-08 19:35
Rajkumar R3-Feb-08 19:35 
GeneralRe: non-pure virtual function in C++ interface Pin
George_George3-Feb-08 19:45
George_George3-Feb-08 19:45 
JokeSuggestion to Chris Pin
Rajesh R Subramanian3-Feb-08 19:24
professionalRajesh R Subramanian3-Feb-08 19:24 
GeneralRe: Suggestion to Chris Pin
CPallini4-Feb-08 0:03
mveCPallini4-Feb-08 0:03 
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 
George_George wrote:

1. Are they correct code?

Yes. Don't forget to call the final release on pI.



George_George wrote:
2. It looks redundant to call so many times of AddRef and Release just to make the counter consistent, if you were me, do you have ways to write better code?


It is the only correct way to handle lifetime of COM objects.

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

[my articles]


GeneralRe: AddRef and Release Pin
George_George3-Feb-08 22:46
George_George3-Feb-08 22:46 
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 

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.