F
fade
Good night
I'm trying to convert a CString into a System::String on a MFC project,
this way:
CString t1("Hello, World!");
#pragma push_macro("new")
#undef new
System::String *s1 = new System::String(t1);
#pragma pop_macro("new")
Everything works ok, but if I try to free s1
delete s1;
an error occurs.
error C3841: illegal delete expression: managed type 'System::String'
does not have a destructor defined
Shouldn't I delete s1? How's responsible for that?
If I'm the responsible, how do I free s1?
Thanks in advance and Merry Xmas to all
I'm trying to convert a CString into a System::String on a MFC project,
this way:
CString t1("Hello, World!");
#pragma push_macro("new")
#undef new
System::String *s1 = new System::String(t1);
#pragma pop_macro("new")
Everything works ok, but if I try to free s1
delete s1;
an error occurs.
error C3841: illegal delete expression: managed type 'System::String'
does not have a destructor defined
Shouldn't I delete s1? How's responsible for that?
If I'm the responsible, how do I free s1?
Thanks in advance and Merry Xmas to all