my code is like this:
void CRrDlg::OnGetText()
{
CString kk;
int f;
CRrDlg* pEdit=(CRrDlg*)GetDlgItem(IDC_EDIT7);
{
f=22;
kk=f;
pEdit->SetWindowText(kk);
}
}
I cant show 22 as output and i don't want to use kk.Format() to display. Is there any way to put variable f as variable kk

Problem in MFC AppWizard(exe)
Dan B.
Example on GetDlgItemText and Append:
#include <stdlib.h>
CString Data, ConvNum;
int Num = 100;
char NumberChar[10];
GetDlgItemText(IDC_EDIT1, Data); //Get The Data
_itoa_s(Num, NumberChar, 9, 10) //Convert Int To Char
ConvNum = NumberChar;
Data += _T(" "); // Insert a Blank Space So Data Is Not Bunched Together;
Data += ConvNum;
SetDlgItemText(IDC_EDIT1, Data); // Place Data Back Into Edit Control
needhelpbad
You'll have to GetWindowText the existing text, append your extra text, and SetWindowText it back to the edit control.
Tstay
ErikH
SetDlgItemInt is the best. Just want to complete your Question though.
To change an int to a char:
#include <stdlib.h>
int Number = 100;
char NumChar[10];
_itoa_s(Number, NumChar, 9, 10);
/* 9 is how many characters to convert 10 is the base. _s is for security only. Oh it also prevents that horrible warning "Declared Depreciated" */
I would use SetDlgItemInt. Less code is always better.
Kindest Regards
Quintin Immelman
Roberto Barrantes
Delucia
Dave1111
PaulTH
It looks as if you are casting a CWnd* to an edit window to a pointer to a CDialog-derived class. Since all you do is call SetWindowText, it's alright, but it's not something I'd do if I were you.
You can do this :-
SetDlgItemInt(IDC_EDIT7, f);