Дебаг C++/cli

22.12.2013
3
0
#1
Пишу в VS2005
error C2143: syntax error : missing ';' before '^'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2061: syntax error : identifier 'User'
error C2065: '_user' : undeclared identifier
error C2065: 'user' : undeclared identifier
error C2227: left of '->aL' must point to class/struct/union/generic type
type is ''unknown-type''
error C2227: left of '->Count' must point to class/struct/union/generic type
error C2227: left of '->aL' must point to class/struct/union/generic type
type is ''unknown-type''
error C2227: left of '->run' must point to class/struct/union/generic type
type is ''unknown-type''

C++:
ref class InterfaceForm : Form
{
protected: User ^_user;

InterfaceForm(User ^user)
{
_user = nullptr;
_user = user;
this->DoubleBuffered = true;
}

virtual void OnPaint(PaintEventArgs ^e) override
{
if (_user == nullptr)
return;
int rzm = 10;
int count = _user->aL->Count;
for (int i = 0; i < count; i++)
{
//Car ^car = safe_cast<Car^>(_user->aL[i]);
Car ^car = (Car)_user->aL[i];
e->Graphics->DrawString("Машина №" + i,
gcnew System::Drawing::Font("Arial", 10),
gcnew SolidBrush(Color::Red),
Point(rzm, 100));

if (_user->run)
{
e->Graphics->DrawString("Машина запущена",
gcnew System::Drawing::Font("Arial", 8),
gcnew SolidBrush(Color::Red),
Point(rzm, 60));
rzm = rzm + 130;
}
else
{
e->Graphics->DrawString("Машина остановлена",
gcnew System::Drawing::Font("Arial", 8),
gcnew SolidBrush(Color::Red),
Point(rzm, 60));
rzm = rzm + 130;
}
}
}
};