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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting text to string

Status
Not open for further replies.

traxxas

Programmer
Dec 11, 2003
15
US
hey guys, i have alittle question im playing with this command

WritePrivateProfileString("el33t", "textBox6", //par3//, "C:el33t.ini");

basicly an INI read/write routine, but i have alittle problem in parimeter 3 (//par3//) i put this in: textBox6->Text so it will put the text in textbox 6 there, unfortunaltly that doesnt work i need to conver that to a LPCSTR

so how to i turn textBox6->Text into an LPCSTR?

thanks for your help guys :)
 

LPCSTR is 32 bit pointer to a constant character string.

This should work:

LPCSTR pText = textBox6->Text;
WritePrivateProfileString("el33t", "textBox6", pText, "C:el33t.ini");

Or you can try typecasting:

WritePrivateProfileString("el33t", "textBox6", (LPCSTR)textBox6->Text, "C:el33t.ini");

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top