So if I understand correctly a BYTE is an unsigned character so here is the code I:
I push a BYTE to an input box as a Hex, and then after the user updates the number and presses OK the number updated value is returned as a CString.
sBuffer will hold the string, but I want temp_num to hold the returned string as a BYTE or unsigned character.
the problem seems to be "temp_num.Format( _T("%u"),input.m_sHexInput);"
wither I haven't given temp_num a class properly or I am going about this all wrong.
Help is greatly appreciated
Rich (BB code):
void CEL505_Lab002Dlg::OnBnClickedButtonInput()
{
// TODO: Add your control notification handler code here
CString sBuffer;
unsigned char temp_num;
InputDlg input;
input.m_sHexInput.Format( _T("%02X"),m_bNumber);
if(input.DoModal() ==IDOK)
{
sBuffer.Format(_T("%s"), input.m_sHexInput);
temp_num.Format( _T("%u"),input.m_sHexInput);
//MessageBox(sBuffer,_T("Custom Dialog Result"),MB_OK | MB_ICONINFORMATION);
}
}
sBuffer will hold the string, but I want temp_num to hold the returned string as a BYTE or unsigned character.
the problem seems to be "temp_num.Format( _T("%u"),input.m_sHexInput);"
wither I haven't given temp_num a class properly or I am going about this all wrong.
Help is greatly appreciated