Click here to Skip to main content
15,899,634 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: PlugIn crashes, but App keeps running - Solution needed Pin
virtualnik10-May-11 3:49
virtualnik10-May-11 3:49 
GeneralRe: PlugIn crashes, but App keeps running - Solution needed Pin
barneyman10-May-11 3:58
barneyman10-May-11 3:58 
AnswerRe: PlugIn crashes, but App keeps running - Solution needed Pin
Stephen Hewitt11-May-11 6:04
Stephen Hewitt11-May-11 6:04 
QuestionATL alternate to .NET profiling Pin
popchecker6-May-11 18:35
popchecker6-May-11 18:35 
AnswerRe: ATL alternate to .NET profiling Pin
barneyman8-May-11 23:30
barneyman8-May-11 23:30 
QuestionBest CWnd for Keyboard and Mouse Input Pin
Koolski5-May-11 7:21
Koolski5-May-11 7:21 
AnswerRe: Best CWnd for Keyboard and Mouse Input Pin
Richard MacCutchan5-May-11 21:25
mveRichard MacCutchan5-May-11 21:25 
QuestionSTL list wrapped inside managed class Pin
Flo Lee5-May-11 4:14
Flo Lee5-May-11 4:14 
Dear all,

I have the task to wrap a list<myobject> inside a .NET wrapper, and actually after some heavy researching and editing, it seems to work, but I dont trust that I have understood all unmanaged issues correctly.

First, I found I should add an operator overload and a copy constructor to my class:
RawCoil::RawCoil(const Core::RawCoil& pParam)
	{
		*this = pParam;
	}

	RawCoil& RawCoil::operator=(const RawCoil &obj)
	{
		this->Id = obj.Id;
		return *this;
	}

Is this correct?

Then, there is the main list variable, which is used inside the unmanaged code. When is the memory allocated/freed, this I don´t understand:
list<RawCoil> coils; //where is this object instantiated? automagically?


Another interesting questions. The List<> from .NET will arrive with new elements from time to time, and I have to synchronize it to the unamanged code:
int unmanageCoils(List<Coil^>^ managedCoils, list<Core::RawCoil> *unmanagedCoils)
	{
		unmanagedCoils->clear();
		for(int i=0;i<managedCoils->Count;i++)
		{
			Coil^ coil = managedCoils[i];
			Core::RawCoil newCoil;  //where is this object instantiated? automagically? 
			newCoil.Id = ManagedToSTL(coil->coilId); //string conversion
			unmanagedCoils->push_back(newCoil);

		}
		return managedCoils->Count;

how is the memory allocation treated for the list elements?

The thing is I want to prevent any leaking of memory, as I am normally only developing in C# and quite paranoid when I have to switch back to old times Smile | :)

kind regards Florian
QuestionBinary tree question Pin
sadas232341s30-Apr-11 8:35
sadas232341s30-Apr-11 8:35 
AnswerRe: Binary tree question Pin
barneyman30-Apr-11 20:37
barneyman30-Apr-11 20:37 
GeneralRe: Binary tree question Pin
sadas232341s30-Apr-11 20:48
sadas232341s30-Apr-11 20:48 
GeneralRe: Binary tree question Pin
barneyman30-Apr-11 20:50
barneyman30-Apr-11 20:50 
GeneralRe: Binary tree question Pin
sadas232341s30-Apr-11 20:55
sadas232341s30-Apr-11 20:55 
GeneralRe: Binary tree question Pin
barneyman30-Apr-11 21:03
barneyman30-Apr-11 21:03 
GeneralRe: Binary tree question Pin
sadas232341s30-Apr-11 21:05
sadas232341s30-Apr-11 21:05 
GeneralRe: Binary tree question Pin
sadas232341s30-Apr-11 21:18
sadas232341s30-Apr-11 21:18 
GeneralRe: Binary tree question Pin
sadas232341s30-Apr-11 21:21
sadas232341s30-Apr-11 21:21 
GeneralRe: Binary tree question Pin
barneyman30-Apr-11 22:13
barneyman30-Apr-11 22:13 
GeneralRe: Binary tree question Pin
barneyman30-Apr-11 22:11
barneyman30-Apr-11 22:11 
GeneralRe: Binary tree question Pin
sadas232341s30-Apr-11 20:52
sadas232341s30-Apr-11 20:52 
GeneralRe: Binary tree question Pin
barneyman30-Apr-11 21:04
barneyman30-Apr-11 21:04 
QuestionMSBuild errors Pin
kasi1427-Apr-11 11:39
kasi1427-Apr-11 11:39 
Questionboost::regex_match Pin
Meisterzunge21-Apr-11 21:01
Meisterzunge21-Apr-11 21:01 
AnswerRe: boost::regex_match Pin
Richard MacCutchan21-Apr-11 22:49
mveRichard MacCutchan21-Apr-11 22:49 
GeneralRe: boost::regex_match Pin
Meisterzunge22-Apr-11 0:07
Meisterzunge22-Apr-11 0:07 

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.