error C3767: 'Gyvatele: candidate function(s) not accessible
May 25, 2010 at 10:39pm UTC
Hello,
I cant rid of that error all the day :S , here's my class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
ref class Gyvatele
{
public :
array <Point^>^ gyv;
int length;
bool IsAlive;
private :
Gyvatele();
void Restart();
};
Gyvatele::Gyvatele()
{
gyv=gcnew array<Point^>(21*15);
length=3;
IsAlive=true ;
Restart();
}
And this error comes up when i try to use object of that class here:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
private : static void Mainloop(System::Object^ sender, System::EventArgs^ e)
{
int i=0;
switch (Direction)
{
case 'L' :
p1=left(p1);
break ;
case 'R' :
p1=right(p1);
break ;
case 'U' :
p1=up(p1);
break ;
case 'D' :
p1=down(p1);
break ;
default :
p1=right(p1);
break ;
}
gr->Clear(Color::LightGreen);
for (i;i<gyv->length;i++)
{
gr->DrawImage(bmp,21*gyv->gyv[i]->X,21*gyv->gyv[i]->Y,21,21);
}
}
error C3767: 'Gyvatele::Gyvatele': candidate function(s) not accessible
Sorry for my english...Thanks in advance:)
Oh and btw is there another way to create array of points?
May 25, 2010 at 10:54pm UTC
Your constructor is hidden.
1 2 3 4 5 6 7 8 9 10
ref class Gyvatele
{
public : // <- make this private
array <Point^>^ gyv;
int length;
bool IsAlive;
private : // <- make this public
Gyvatele();
void Restart();
};
May 26, 2010 at 7:02am UTC
That helped, thank you so much :))
Topic archived. No new replies allowed.