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

Managed C++/CLI

 
AnswerRe: After CLR conversion debugging is slow. Pin
Luc Pattyn27-Feb-09 7:02
sitebuilderLuc Pattyn27-Feb-09 7:02 
Questionifstream & ofstream manipulators equivalents in C++/CLI Pin
J_E_D_I26-Feb-09 1:19
J_E_D_I26-Feb-09 1:19 
AnswerRe: ifstream & ofstream manipulators equivalents in C++/CLI Pin
N a v a n e e t h26-Feb-09 3:42
N a v a n e e t h26-Feb-09 3:42 
GeneralRe: ifstream & ofstream manipulators equivalents in C++/CLI Pin
J_E_D_I27-Feb-09 10:03
J_E_D_I27-Feb-09 10:03 
GeneralRe: ifstream & ofstream manipulators equivalents in C++/CLI Pin
N a v a n e e t h1-Mar-09 13:25
N a v a n e e t h1-Mar-09 13:25 
QuestionWhen prefer to write managed C++ code ? Pin
Yanshof25-Feb-09 11:46
Yanshof25-Feb-09 11:46 
AnswerRe: When prefer to write managed C++ code ? Pin
Mark Salsbery25-Feb-09 14:30
Mark Salsbery25-Feb-09 14:30 
AnswerRe: When prefer to write managed C++ code ? Pin
N a v a n e e t h25-Feb-09 14:40
N a v a n e e t h25-Feb-09 14:40 
Yanshof wrote:
Is not managed class is actually native


Depends on what you mean by native. Managed class instances will be allocated on managed heap and will be controlled by runtime.

Yanshof wrote:
I don't know when to choose managed class and when to choose not managed class.


Most of the people use C++/CLI for creating managed wrapper for unmanaged classes. If you use C++/CLI, you don't need to use unmanaged classes. Always try to use managed classes..NET framework class library is richer than standard C++ library. So you hardly need to use unmanaged classes in C++/CLI.

Yanshof wrote:
What about virtual destructor ? is Garbage collector work like in C# in those cases ?


Garbage collector is part of .NET framework and it works well with managed C++. It will work only managed types. If you allocate memory for a unmanaged class, you need to explicitly remove it and garbage collector won't take care. Consider the following code,
ref class ManagedFoo
{
};

class UnmanagedFoo
{
};

int main(array<System::String ^> ^args)
{
	ManagedFoo^ managedFoo = gcnew ManagedFoo(); // no need to delete it as this is garbage collected
	UnmanagedFoo* unmanagedFoo = new UnmanagedFoo();
	delete unmanagedFoo;	// explicitly deleting as this is not garbage collected
     return 0;
}


Smile | :)


QuestionBoolean property causing crash Pin
Andy____________uk24-Feb-09 1:35
Andy____________uk24-Feb-09 1:35 
GeneralRe: Boolean property causing crash Pin
Luc Pattyn24-Feb-09 1:42
sitebuilderLuc Pattyn24-Feb-09 1:42 
GeneralRe: Boolean property causing crash Pin
Andy____________uk24-Feb-09 2:01
Andy____________uk24-Feb-09 2:01 
GeneralRe: Boolean property causing crash Pin
Luc Pattyn24-Feb-09 2:33
sitebuilderLuc Pattyn24-Feb-09 2:33 
GeneralRe: Boolean property causing crash Pin
Andy____________uk24-Feb-09 3:01
Andy____________uk24-Feb-09 3:01 
QuestionConverting int to string confusion Pin
TabascoSauce23-Feb-09 15:33
TabascoSauce23-Feb-09 15:33 
GeneralRe: Converting int to string confusion Pin
Luc Pattyn23-Feb-09 16:07
sitebuilderLuc Pattyn23-Feb-09 16:07 
QuestionC++/CLI -- Where to declare pre-selected list box and radio button attributes? Pin
J_E_D_I22-Feb-09 7:53
J_E_D_I22-Feb-09 7:53 
AnswerRe: C++/CLI -- Where to declare pre-selected list box and radio button attributes? Pin
Mark Salsbery22-Feb-09 18:22
Mark Salsbery22-Feb-09 18:22 
GeneralRe: C++/CLI -- Where to declare pre-selected list box and radio button attributes? Pin
J_E_D_I23-Feb-09 9:49
J_E_D_I23-Feb-09 9:49 
QuestionAVI to BMP Frames Pin
santoshsb06121-Feb-09 8:45
santoshsb06121-Feb-09 8:45 
AnswerRe: AVI to BMP Frames Pin
Mark Salsbery22-Feb-09 18:26
Mark Salsbery22-Feb-09 18:26 
QuestionFunctions Pin
Visiolizer21-Feb-09 6:54
Visiolizer21-Feb-09 6:54 
AnswerRe: Functions Pin
Eytukan22-Feb-09 19:55
Eytukan22-Feb-09 19:55 
AnswerRe: Functions Pin
Gary R. Wheeler23-Feb-09 11:53
Gary R. Wheeler23-Feb-09 11:53 
GeneralRe: Functions Pin
Luc Pattyn23-Feb-09 12:30
sitebuilderLuc Pattyn23-Feb-09 12:30 
QuestionTwo problems - (a) HOW TO: pointer to an EXISTING user-defined type (b)HOW: lost form design window Pin
regnwald16-Feb-09 18:19
regnwald16-Feb-09 18:19 

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.