|
You cant access the control variables after the dialog is destroyed.
You need to store the values in strings and access them after the DoModal() call.
Regards,
Sandip.
|
|
|
|
|
sorry..this is not working at all..
|
|
|
|
|
what is not working paste your code
Regards,
Sandip.
|
|
|
|
|
Addcam c;<br />
c.DoModal();<br />
CString st;<br />
st=GetDlgItemText(IDC_EDIT1,c.strTemp);<br />
AfxMessageBox(st);
have added strTemp in Addcam class.
Addcam::Addcam(CWnd* pParent )<br />
: CDialog(Addcam::IDD, pParent)<br />
{<br />
CString strTemp;<br />
<br />
}
|
|
|
|
|
CString strTemp;
should be class member of AddCam
projectip wrote: st=GetDlgItemText(IDC_EDIT1,c.strTemp);
should be inside AddCam::OnOK()//
then just write
Addcam c;
c.DoModal();
AfxMessageBox(c.strTemp);
I hope its making sense to you..
Regards,
Sandip.
|
|
|
|
|
That is a very helpfull answer . Why can't you say what is not working ? How can we guess what the problem is ?
If you want an answer, you have to provide some information for us to be able to help you.
|
|
|
|
|
I have given the strTremp in Addcam::OK.But still the messagebox displays nothing.
|
|
|
|
|
Is strTemp member variable of dialog AddCam??
paste the code where you have declared the strTemp.
Regards,
Sandip.
|
|
|
|
|
void Addcam::OnOK() <br />
{<br />
<br />
CDialog::OnOK();<br />
CString strTemp;<br />
}
|
|
|
|
|
Hi Please make it calss member by declaring it in calss definition .h file.
//AddCam.h
class AddCam: public CDialog
{
public:
CString strTemp;
...
}
void Addcam::OnOK()
{
// TODO: Add extra validation here
GetDlgItemText(IDC_EDIT1,strTemp) //IDC_EDIT1 is supposed to be your EDIT box id.
CDialog::OnOK();
}
Are you getting me??
Regards,
Sandip.
|
|
|
|
|
Thank you sooooo much...now it works.....seems like i failed to explain my problem in a clear way..will correct it from next time onwards.
|
|
|
|
|
Hello all,
I want to get character value from an ASCII value. That is, if i pass 65 then I should get 'A' in return. So how could i easily accomplish this??
Please help me out..
Thanks & Regards,
Hemang
|
|
|
|
|
char c = 65;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
That's crazy... You gave the same answer than me and you got downvoted while I got a 5
|
|
|
|
|
However, don't worry, I don't mind about down voters (and after all, I have a lot of friends).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
char c = 65;
It's as easy as that. Now your c character holds the 'A' letter.
|
|
|
|
|
printf("%c",i); // i could have any integer value
Put in other words you can simply typecast an int to a char to get its ASCII value
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
CString csTemp;
csTemp.Format( "%c", 65 );
Will result "A" in csTemp.
akt
|
|
|
|
|
If you want a function anyway:
char getCharEquivalent(int i)
{
char c = i;
return c;
}
void main()
{
int i = 65;
char cCharEquiv = getCharEquivalent(i);
}
Put a break point inside main and check cCharEquiv, it will be 'A'
ASCII is nothing but numeric value of the character.
--
"Programming is an art that fights back!"
|
|
|
|
|
Though my problem was of different sort but i got clue from all your answers. So i am very thankful to you guys as usual. I am really touched.
Cheers,
Hemang
|
|
|
|
|
char c= (char)65;
-@SuDhIrKuMaR@-
|
|
|
|
|
Why char c= (char)65; when we can use of char c = 65; ?
|
|
|
|
|
Hi all,
I m using OnInitDialog() for dialog box initialization and OninitialUpdate() use for Formview.
please what function is used for MainFrame initialization.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: what function is used for MainFrame initialization.
OnCreate
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
If you want to add remove differrent property of the MainFrame you can use MainFrame::PreCreateWindow() or OnCreate()fucntions.
akt
|
|
|
|