Click here to Skip to main content
15,917,568 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problems with HHOOK variable Pin
David Crow28-Mar-05 9:51
David Crow28-Mar-05 9:51 
GeneralRe: Problems with HHOOK variable Pin
r3dqu33n28-Mar-05 10:03
r3dqu33n28-Mar-05 10:03 
GeneralRe: Problems with HHOOK variable Pin
David Crow28-Mar-05 10:22
David Crow28-Mar-05 10:22 
GeneralBitmap Data Manipulation Pin
LighthouseJ28-Mar-05 7:07
LighthouseJ28-Mar-05 7:07 
GeneralRe: Bitmap Data Manipulation Pin
Chris Losinger28-Mar-05 10:42
professionalChris Losinger28-Mar-05 10:42 
GeneralRe: Bitmap Data Manipulation Pin
LighthouseJ28-Mar-05 12:23
LighthouseJ28-Mar-05 12:23 
Generalerror - edit box variable cannot be evaluated Pin
theFrenchHornet28-Mar-05 5:22
theFrenchHornet28-Mar-05 5:22 
GeneralRe: error - edit box variable cannot be evaluated Pin
David Crow28-Mar-05 6:02
David Crow28-Mar-05 6:02 
theFrenchHornet wrote:
In the first initDialog of the program...

You have more than one?

theFrenchHornet wrote:
There is an edit box for the user to enter a value. It is declared as:

double m_newBP;


The variable associated with the edit control should be CEdit.

theFrenchHornet wrote:
void CModeCtrlDlg::OnBnClickedChangeBP ()
{
CGetNewBP getNewBP = new CGetNewBP;
INT_PTR nResponse = getNewBP.DoModal();
delete getNewBP;
m_currentBP = currentBP; <- error message that m_currentBP cannot be evaluated
UpdateData(false);
}


Several things wrong here. First, don't use a heap-based variable unnecessarily. Second, UpdateData() is also unnecessary. Third, too many variable involved. Fourth, getNewBP is not a pointer so the new operator cannot be used. Try something like this instead:

class CGetNewBP : public CDialog
{
public:
    CEdit m_edit;
    double m_BP; // you could also make this a CString and do the atof()
                 // conversion in the OnBnClickedChangeBP() method
};

void CGetNewBP::OnOK()
{
    CString str;
    
    m_edit.GetWindowText(str);
    m_BP = atof(str);
}
...
class CModeCtrlDlg : public CDialog
{
public:
    CEdit m_editBP;
};
...
void CModeCtrlDlg::OnBnClickedChangeBP()
{
    CGetNewBP dlg;
    INT_PTR nResponse = dlg.DoModal();
    if (IDOK == nResponse)
    {
        CString str;
 
        str.Format("%f", dlg.m_BP);
        m_editBP.SetWindowText(str);
    }
}
Make sense?


"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow


GeneralRe: error - edit box variable cannot be evaluated Pin
theFrenchHornet28-Mar-05 6:35
theFrenchHornet28-Mar-05 6:35 
Generaltopmost window stye without getting the focus Pin
Cris28-Mar-05 3:40
Cris28-Mar-05 3:40 
GeneralRe: topmost window stye without getting the focus Pin
ThatsAlok28-Mar-05 17:47
ThatsAlok28-Mar-05 17:47 
GeneralRe: topmost window stye without getting the focus Pin
Cris29-Mar-05 8:10
Cris29-Mar-05 8:10 
GeneralMPEG-2 Transport Stream converter Pin
Alexander M.,28-Mar-05 3:15
Alexander M.,28-Mar-05 3:15 
Generalproblem with DLL and CString Pin
eli1502197928-Mar-05 3:06
eli1502197928-Mar-05 3:06 
GeneralRe: problem with DLL and CString Pin
Joel Holdsworth28-Mar-05 3:39
Joel Holdsworth28-Mar-05 3:39 
GeneralRe: problem with DLL and CString Pin
Alexander M.,28-Mar-05 3:41
Alexander M.,28-Mar-05 3:41 
GeneralRe: problem with DLL and CString Pin
eli1502197928-Mar-05 3:58
eli1502197928-Mar-05 3:58 
GeneralRe: problem with DLL and CString Pin
Blake Miller28-Mar-05 4:39
Blake Miller28-Mar-05 4:39 
GeneralRe: problem with DLL and CString Pin
jogibaer7914-Apr-05 1:35
jogibaer7914-Apr-05 1:35 
GeneralRe: problem with DLL and CString Pin
Blake Miller14-Apr-05 4:17
Blake Miller14-Apr-05 4:17 
QuestionHow to display MultiLine in MFCGrid Cell Pin
UrbanBlues28-Mar-05 2:26
UrbanBlues28-Mar-05 2:26 
AnswerRe: How to display MultiLine in MFCGrid Cell Pin
PJ Arends28-Mar-05 6:44
professionalPJ Arends28-Mar-05 6:44 
GeneralRuntime selection of Multiple String Table Pin
CookieT28-Mar-05 2:25
CookieT28-Mar-05 2:25 
QuestionHow do I change the tooltip of a title bar button? Pin
Hiigara28-Mar-05 2:18
Hiigara28-Mar-05 2:18 
AnswerRe: How do I change the tooltip of a title bar button? Pin
Alexander M.,28-Mar-05 13:41
Alexander M.,28-Mar-05 13:41 

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.