Solved

visual c++ database building

Posted on 1998-08-09
2
295 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at 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 clear a vector as well as how to detect empty vectors in C++.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now