c++ - convert unicodestring to string in xrad studio -


i have problem in "rad studio 10 seattle" trying text input tedit object , errormessage saying

e2034 cannot convert 'unicodestring' 'string'

my code follows:

this->shopvar->adddog(edname->text, strtoint(edage->text), "male", "dogspecial"); 

this function adddog takes (string, int, string, string)
when try send text tedit object edname->text errormessage mentioned earlier.

my question follows, can make convertion on edname unicodestring string or have change datatype of parameterlist? if so, how do it?
have been searching issue have not found similar problem.

you need convert unicodestring data ansi first, pass instead. easiest way assign unicodestring ansistring (or derivative) first, , use c_str() method char* pointer, std::string accept:

this->shopvar->adddog(ansistring(edname->text).c_str(), ...); 

if possible, maybe consider rewriting shopvar class use std::wstring instead, can remove ansi conversion:

this->shopvar->adddog(edname->text.c_str(), strtoint(edage->text), l"male", l"dogspecial"); 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -