• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

visual c++ database building

What is wrong with the code here? the part on: (CString str = col + " =  ' "+  dlg.m_filterValue + ' ";
Written something about
{ error C2679: binary '+' : no operator defined which takes a right-hand operand of type 'class CEdit' (or there is no acceptable conversion
void CSignatureDatabaseView::DoFilter(CString col)
{
    CFilterDlg dlg;
    int result = dlg.DoModal();
    if (result == IDOK)
    {
        CString str = col + " = '"+  dlg.m_filterValue + "'";
        m_pSet->Close();
        m_pSet->m_strFilter = str;
        m_pSet->Open();
        int recCount = m_pSet->GetRecordCount();
        if (recCount == 0)
        {
            MessageBox("No matching records.");
            m_pSet->Close();
            m_pSet->m_strFilter = "";
            m_pSet->Open();
        }

 
      UpdateData(FALSE);

    }
}
0
cheeonn
Asked:
cheeonn
1 Solution
 
cheeonnAuthor Commented:
Really desperately need an answer....thanking you in advance..thank you...thank you....thank you...thank you..
0
 
snoeglerCommented:
Your 'm_filterValue' has been selected as a 'CEdit' control, not as a 'CString' as you expect in
the line which causes the error. Either you select it as a 'CString' (by deleting the member
variable and adding it as a 'CString' exchange type) or you replace
m_filterValue with m_filterValue.GetText().
(BTW: you should post MFC questions in the MFC section)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now