I have a System Block class that aggregates 2 classes: Mouse and Monitor. All these classes are heirs of the base class: Computer, in which there is a variable: name_of_module and the method that calls this variable. With this function, I get access to the name of the mouse (which is connected to the system unit):
string System_Block::getMouseName() { return Mous.get_name(); } Next, I try to assign this Label5 value from the Windows Form:
std::string namem = Comps[number_of_SB].getMouseName(); label2->Text = System::Convert::ToString(number_of_SB+1); label5->Text = namem;//Здесь ошибка, подсвечивается label5 But an error occurs:
function "System :: Windows :: Forms :: Label :: Text :: set"
What is the problem?
label5->Text = namem- must be in this one. Typelabel5->TextprobablyString^? And you are trying to initialize a variable ofтипа std::string. - isnullxbhSystem::Convert::ToString(), another error will be generated: no instance of overloaded function "System :: Convert :: ToString" matches the argument list - nait123321