Solved

visual c++ database building

Posted on 1998-08-09
2
304 Views
Last Modified: 2012-06-21
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
Comment
Question by:cheeonn
2 Comments
 

Author Comment

by:cheeonn
ID: 1169770
Really desperately need an answer....thanking you in advance..thank you...thank you....thank you...thank you..
0
 
LVL 6

Accepted Solution

by:
snoegler earned 30 total points
ID: 1169771
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question