I am trying to use a Win32 textbox (EDITTEXT) to display certain words when you press certain buttons. I know how to use them to display numerical outputs, but I'm not sure how to display strings with them. I've given it a go anyhow, and I have the following:
It isn't working at the moment (it just puts '0' in the box) so I was wondering if anyone could offer some tips?
case IDC_HELLOBUTTON: //Press this button to write 'Hello'.
char strHi; //A char to store the string contents.
std::string outputstring; //A string to store 'Hello'.
outputstring += "Hello"; //Adding 'Hello' to the string.
sprintf_s(strHi,"%0.0f",outputstring); //Putting the string in the char array.
SetDlgItemText(hwnd, IDC_OUTPUT, strHi); //Writing the char's contents in the box.