Click here to Skip to main content
15,920,508 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: What makes a class IDisposable? Pin
mid=574113-Aug-07 9:30
mid=574113-Aug-07 9:30 
GeneralRe: What makes a class IDisposable? Pin
iddqd51513-Aug-07 9:36
iddqd51513-Aug-07 9:36 
GeneralRe: What makes a class IDisposable? Pin
Mark Salsbery13-Aug-07 9:38
Mark Salsbery13-Aug-07 9:38 
GeneralRe: What makes a class IDisposable? [modified] Pin
iddqd51513-Aug-07 9:43
iddqd51513-Aug-07 9:43 
GeneralRe: What makes a class IDisposable? Pin
Mark Salsbery13-Aug-07 9:51
Mark Salsbery13-Aug-07 9:51 
GeneralRe: What makes a class IDisposable? Pin
iddqd51513-Aug-07 9:55
iddqd51513-Aug-07 9:55 
GeneralRe: What makes a class IDisposable? Pin
Luc Pattyn13-Aug-07 7:00
sitebuilderLuc Pattyn13-Aug-07 7:00 
GeneralRe: What makes a class IDisposable? Pin
Mark Salsbery12-Aug-07 10:06
Mark Salsbery12-Aug-07 10:06 
Michael Chapman wrote:
That just seems totally counterintuitive to using managed code.


Yes, but so is mixing native types and having destructors.
The garbage collector will only cleanup managed objects if you don't specifically call a destructor.

Since you don't need deterministic cleanup of your native object, the smart pointer is a good solution,
since it provides the destructor/finalizer for you.
Only if you needed deterministic cleanup of your native object would you need to implement a destructor
and possibly a finalizer as shown in the article (although you do it implicitely with the smart pointer).

Mark




Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: What makes a class IDisposable? Pin
George L. Jackson14-Aug-07 3:48
George L. Jackson14-Aug-07 3:48 
GeneralRe: What makes a class IDisposable? Pin
Mark Salsbery14-Aug-07 5:10
Mark Salsbery14-Aug-07 5:10 
GeneralRe: What makes a class IDisposable? Pin
Mark Salsbery13-Aug-07 4:53
Mark Salsbery13-Aug-07 4:53 
QuestionControl within a control help please [modified] Pin
Xpnctoc11-Aug-07 6:54
Xpnctoc11-Aug-07 6:54 
Questionassignment vs default ctor Pin
swjam11-Aug-07 5:19
swjam11-Aug-07 5:19 
AnswerRe: assignment vs default ctor Pin
Mark Salsbery11-Aug-07 6:55
Mark Salsbery11-Aug-07 6:55 
Questionoperator++(int) Pin
swjam11-Aug-07 4:58
swjam11-Aug-07 4:58 
AnswerRe: operator++(int) Pin
Mark Salsbery11-Aug-07 6:58
Mark Salsbery11-Aug-07 6:58 
AnswerRe: operator++(int) Pin
BadKarma11-Aug-07 23:48
BadKarma11-Aug-07 23:48 
QuestionRTTI dynamic_cast Pin
swjam11-Aug-07 0:45
swjam11-Aug-07 0:45 
AnswerRe: RTTI dynamic_cast [modified] Pin
swjam11-Aug-07 0:51
swjam11-Aug-07 0:51 
QuestionIn C++/CLI, What has replaced LOGFONT and TEXTMETRIC? Pin
BuckBrown10-Aug-07 12:05
BuckBrown10-Aug-07 12:05 
QuestionHow do you get screen graphics into Document? Pin
BuckBrown9-Aug-07 9:54
BuckBrown9-Aug-07 9:54 
AnswerRe: How do you get screen graphics into Document? Pin
Luc Pattyn9-Aug-07 10:40
sitebuilderLuc Pattyn9-Aug-07 10:40 
GeneralRe: How do you get screen graphics into Document? Pin
BuckBrown9-Aug-07 11:05
BuckBrown9-Aug-07 11:05 
GeneralRe: How do you get screen graphics into Document? Pin
Luc Pattyn9-Aug-07 11:18
sitebuilderLuc Pattyn9-Aug-07 11:18 
GeneralRe: How do you get screen graphics into Document? Pin
BuckBrown9-Aug-07 11:40
BuckBrown9-Aug-07 11:40 

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.