Vector Problem

Hi guys, How do you create a vector for a class you defined because this does not work for some reason:

1
2
3
4
5
6
...
	vector<wxPoint> Start;
...
wxPoint position=event.GetLogicalPosition(wxClientDC(this));
	Start.push_back(position);
...


please help!!!
That looks like that should work fine...what exactly are the error messages?
That should work. Perhaps the class cannot be copied like that.

In that case, try something like the following. It will create a wxPoint object with the event. stuff as the argment for the constructor.
1
2
vector<wxPoint> Start;
Start.push_back( wxPoint(event.GetLogicalPosition(wxClientDC(this))) );


Or perhaps the following if event.GetLogicaPosition() returns a wxPoint class.
Start.push_back( event.GetLogicalPosition(wxClientDC(this)) );
Last edited on
I'd make a vector of class pointers and 'new' and 'delete' each pointer.
Last edited on
Topic archived. No new replies allowed.