Quote Originally Posted by o.fithcheallaigh View Post
I have tried a different approach [...].
Obviously. Now that defininitely is native C++ with MFC, so there's no such thing as a Text property or MessageBox::Show() or int::ToString() methods. Questions about that should better be asked in the Visual C++ section.

And I am getting an error "error C2664: 'CWnd::SetDlgItemTextA' : cannot convert parameter 2 from 'char' to 'LPCTSTR' ...Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast"
The error message is rather obvious, I'd say: The method expects an LPCTSTR, which is a synonym for either char * or wchar_t *, depending on whether it's an MBCS or Unicode build. A char isn't implicitly convertible into that (and it's definitely better that it is that way - comment by me, not the error message ).

This could serve as a quick and dirty fix:

Code:
	char a[2] = {0};

	// ...

	a[0] = (char)*(p+1);

	SetDlgItemText(IDC_EDIT2, a);