Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type cast to System::Object

Status
Not open for further replies.

gavsta2k

Programmer
Mar 7, 2006
2
GB
I am using vc++ 2005 express and mysql. i am reading items in from a db which returns type Char* and i need to add the items to a listbox, if i do :

listBox1->Items->Add(row);

i get error C2440: 'type cast' : cannot convert from 'char *' to 'System::Object ^'

what is the best way round this?

thanks
 
Hi, no this did not work eiter, turns out the correct code is:
listBox1->Items->Add(gcnew String(row));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top