Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How do i use a CString in a non-MFC app? Pin
John M. Drescher6-Jun-02 6:08
John M. Drescher6-Jun-02 6:08 
AnswerRe: How do i use a CString in a non-MFC app? Pin
Ramon Casellas6-Jun-02 6:20
Ramon Casellas6-Jun-02 6:20 
GeneralRe: How do i use a CString in a non-MFC app? Pin
Rage6-Jun-02 6:21
professionalRage6-Jun-02 6:21 
GeneralRe: How do i use a CString in a non-MFC app? Pin
6-Jun-02 7:17
suss6-Jun-02 7:17 
Generalupdate controls based on other inputs Pin
jimNLX6-Jun-02 5:33
jimNLX6-Jun-02 5:33 
GeneralRe: update controls based on other inputs Pin
Rage6-Jun-02 6:16
professionalRage6-Jun-02 6:16 
GeneralRe: update controls based on other inputs Pin
jimNLX6-Jun-02 7:54
jimNLX6-Jun-02 7:54 
GeneralRe: update controls based on other inputs Pin
Rage6-Jun-02 8:21
professionalRage6-Jun-02 8:21 
OK: It does not sound very complicated...

First, draw your dialog and create a class associated to it, let´s name it CKeypadDlg. If you are already lost, mail back Big Grin | :-D

Add a member
int * m_Response


Then overload the DoModal function like this :

int CKeypadDlg::DoModal(int *response)
{
m_Response=response;
return CDialog::DoModal()
}


declare a CString in your KeypadDLg:

CString m_Result


On your second dialog box, you should have a control associated to your CEditBox (let´s name it m_EditCtrl).

When the user clicks on button 1 for instance you will have to catch it in a OnButton... function - Double Click on the Button in the Dialog, and you´ll get :

void CKeypadDlg::OnButton1()
{
   m_Result+="1";
   m_EditCtrl.SetWindowText((LPCTSTR)(LPTSTR)(m_Result))
}


Same code for all button ...

To get the current result at any moment
int Result_i=_atoi(m_Result);


Finally, override OnOk() with

void CKeypadDlg::OnOK() 
{
	*m_Response=_atoi(m_Result);
	CDialog::OnOK();
}


Oufff ...

use it ike this :

CKeypadDlg myDlg
int final_result=0;
myDlg.DoModal(final_result);
//And here you get the result once the dialog is closed ...


Hope this helps ...





~RaGE();
QuestionHow do i use IShellFolder::ParseDisplayName correctly? Pin
redeemer6-Jun-02 5:25
redeemer6-Jun-02 5:25 
GeneralDSP Boards Pin
Brian Azzopardi6-Jun-02 4:39
Brian Azzopardi6-Jun-02 4:39 
GeneralRe: DSP Boards Pin
Roger Allen6-Jun-02 4:37
Roger Allen6-Jun-02 4:37 
GeneralRe: DSP Boards Pin
Brian Azzopardi6-Jun-02 4:52
Brian Azzopardi6-Jun-02 4:52 
Generalclose view but leave document open Pin
Gary Kirkham6-Jun-02 4:28
Gary Kirkham6-Jun-02 4:28 
GeneralRe: close view but leave document open Pin
Tomasz Sowinski6-Jun-02 4:35
Tomasz Sowinski6-Jun-02 4:35 
GeneralRe: close view but leave document open Pin
Gary Kirkham6-Jun-02 4:49
Gary Kirkham6-Jun-02 4:49 
GeneralRe: close view but leave document open Pin
Tomasz Sowinski6-Jun-02 4:52
Tomasz Sowinski6-Jun-02 4:52 
GeneralRe: close view but leave document open Pin
Gary Kirkham6-Jun-02 15:37
Gary Kirkham6-Jun-02 15:37 
GeneralEmpty document on SDI App Pin
6-Jun-02 3:51
suss6-Jun-02 3:51 
GeneralRe: Empty document on SDI App Pin
Tomasz Sowinski6-Jun-02 4:10
Tomasz Sowinski6-Jun-02 4:10 
GeneralSynchronization problem (how do I make it read-only?) Pin
6-Jun-02 3:11
suss6-Jun-02 3:11 
GeneralRe: Synchronization problem (how do I make it read-only?) Pin
6-Jun-02 3:19
suss6-Jun-02 3:19 
GeneralCode to change data from Big Endian to Little Endian Pin
JMajors986-Jun-02 3:19
JMajors986-Jun-02 3:19 
GeneralRe: Code to change data from Big Endian to Little Endian Pin
6-Jun-02 3:16
suss6-Jun-02 3:16 
GeneralRe: Code to change data from Big Endian to Little Endian Pin
Joaquín M López Muñoz6-Jun-02 3:46
Joaquín M López Muñoz6-Jun-02 3:46 
Generalusing SAFEARRAY Pin
RaphaelBr6-Jun-02 2:24
RaphaelBr6-Jun-02 2:24 

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.