Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [mfc, custom control] Default Button Pin
csrss13-Oct-11 9:06
csrss13-Oct-11 9:06 
GeneralRe: [mfc, custom control] Default Button Pin
André Kraak13-Oct-11 9:12
André Kraak13-Oct-11 9:12 
QuestionRegistry - basic questions - read / write in MFC VC++ Pin
Vaclav_13-Oct-11 5:25
Vaclav_13-Oct-11 5:25 
QuestionRe: Registry - basic questions - read / write in MFC VC++ Pin
David Crow13-Oct-11 5:36
David Crow13-Oct-11 5:36 
AnswerRe: Registry - basic questions - read / write in MFC VC++ Pin
Vaclav_13-Oct-11 7:13
Vaclav_13-Oct-11 7:13 
AnswerRe: Registry - basic questions - read / write in MFC VC++ Pin
Richard MacCutchan13-Oct-11 5:53
mveRichard MacCutchan13-Oct-11 5:53 
QuestionTo ask the user information via keyboard Pin
antonio34312-Oct-11 11:40
antonio34312-Oct-11 11:40 
AnswerRe: To ask the user information via keyboard Pin
Maximilien12-Oct-11 14:04
Maximilien12-Oct-11 14:04 
(I will only give partial answer, just to get you going... look for tutorials/sample/example for more complete code and/or documentation)
You cannot access dialog control before a DoModal (the controls are not created yet) or after a DoModal (the control were destroyed).


In your dlgSL1 dialog code, add a CString variable and "attach" it to the CEdit (IDC_EDIT1) with DDX_Control with something like:

C++
DDX_Control(pDX, IDC_EDIT1, m_YouStringVariable);


This can be done manually or with the wizard or the properies (I think); when that is working properly, you can set/get the variable from the parent dialog (in your case: CDlgResultados::OnBnClickedButton1)

C#
if(dlgSL1.DoModal()==IDOK)
{
  nombre= dlgSL1.m_YourStringVariable;
}




Another way is to override the CDialog::OnOK in the CDlgSaveLoad class and in there, you can get the string from the CEdit and put it in an intermediate variable:

C++
void CDlgSaveLoad::OnOK()
{
   // m_YourEdit is a member variable of type CEdit 
   // m_YourStringVariable is a member variable of type CString.
   m_YourEdit.GetWindowText(m_YourStringVariable);

   CDialog::OnOK();
}


and the code in CDlgResultados::OnBnClickedButton1 will be similar as above.

Max.
Watched code never compiles.

GeneralRe: To ask the user information via keyboard Pin
Madhu Nair12-Oct-11 18:26
Madhu Nair12-Oct-11 18:26 
GeneralRe: To ask the user information via keyboard Pin
antonio34313-Oct-11 7:10
antonio34313-Oct-11 7:10 
GeneralRe: To ask the user information via keyboard Pin
Maximilien13-Oct-11 7:41
Maximilien13-Oct-11 7:41 
GeneralRe: To ask the user information via keyboard Pin
antonio34313-Oct-11 9:05
antonio34313-Oct-11 9:05 
GeneralRe: To ask the user information via keyboard Pin
antonio34313-Oct-11 9:10
antonio34313-Oct-11 9:10 
GeneralRe: To ask the user information via keyboard Pin
Maximilien13-Oct-11 9:25
Maximilien13-Oct-11 9:25 
GeneralRe: To ask the user information via keyboard Pin
antonio34313-Oct-11 14:38
antonio34313-Oct-11 14:38 
GeneralRe: To ask the user information via keyboard Pin
antonio34314-Oct-11 23:10
antonio34314-Oct-11 23:10 
QuestionIdea of Activation of software Pin
002comp12-Oct-11 2:02
002comp12-Oct-11 2:02 
AnswerRe: Idea of Activation of software Pin
Rajesh R Subramanian12-Oct-11 3:01
professionalRajesh R Subramanian12-Oct-11 3:01 
AnswerRe: Idea of Activation of software Pin
Chuck O'Toole12-Oct-11 4:33
Chuck O'Toole12-Oct-11 4:33 
AnswerRe: software protection and activation Pin
Software_Developer12-Oct-11 21:38
Software_Developer12-Oct-11 21:38 
GeneralRe: software protection and activation Pin
002comp13-Oct-11 0:59
002comp13-Oct-11 0:59 
Questionchanging column value to hyper link Pin
VCProgrammer12-Oct-11 1:24
VCProgrammer12-Oct-11 1:24 
AnswerRe: changing column value to hyper link Pin
Richard MacCutchan12-Oct-11 1:59
mveRichard MacCutchan12-Oct-11 1:59 
GeneralRe: changing column value to hyper link Pin
VCProgrammer12-Oct-11 2:05
VCProgrammer12-Oct-11 2:05 
AnswerRe: changing column value to hyper link Pin
Rolf Kristensen12-Oct-11 2:21
Rolf Kristensen12-Oct-11 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.