请教:error C2678: binary '==' : no operator defined which takes a left-hand operand of type 'class CListBox'
// featuremodelingDlg.cpp : implementation file
//
#include "stdafx.h"
#include "featuremodeling.h"
#include "featuremodelingDlg.h"
#include "lunpandlg.h"
#include <Cstring>
#include <iostream>
using std::operator ==;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFeaturemodelingDlg dialog
CFeaturemodelingDlg::CFeaturemodelingDlg(CWnd* pParent /*=NULL*/)
: CDialog(CFeaturemodelingDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CFeaturemodelingDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CFeaturemodelingDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFeaturemodelingDlg)
DDX_Control(pDX, IDC_LIST1, m_sfeature);
DDX_Control(pDX, IDC_FEATURE, m_feature);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFeaturemodelingDlg, CDialog)
//{{AFX_MSG_MAP(CFeaturemodelingDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_CANCEL, OnCancel)
ON_BN_CLICKED(IDC_DISPLAY, OnDisplay)
ON_BN_CLICKED(IDC_OK, OnOk)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFeaturemodelingDlg message handlers
BOOL CFeaturemodelingDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
strcpy(lunpan[0],"涡轮盘体");
strcpy(suncao[0],"半圆弧两齿榫槽");
strcpy(suncao[1],"常规三齿榫槽");
strcpy(suncao[2],"常规四齿榫槽");
strcpy(suncao[3],"常规五齿榫槽");
strcpy(suncao[4],"双榫根榫槽");
strcpy(anzhuangbian[0],"销钉连接");
strcpy(anzhuangbian[1],"短螺栓连接");
strcpy(anzhuangbian[2],"套齿连接");
strcpy(anzhuangbian[3],"长螺栓连接");
strcpy(anzhuangbian[4],"焊接");
strcpy(anzhuangbian[5],"端面齿连接");
strcpy(fujiajiegou[0],"前篦齿环");
strcpy(fujiajiegou[1],"后篦齿环");
strcpy(fujiajiegou[2],"前平衡配重环");
strcpy(fujiajiegou[3],"后平衡配重环");
strcpy(fujiajiegou[4],"冷却孔");
strcpy(fujiajiegou[5],"均压孔");
strcpy(fujiajiegou[6],"鼓筒");
strcpy(pan,"轮盘");
strcpy(cao,"榫槽");
strcpy(bian,"安装边");
strcpy(fujia,"附加结构");
this->m_feature.AddString((LPCTSTR)pan);
this->m_feature.AddString((LPCTSTR)cao);
this->m_feature.AddString((LPCTSTR)bian);
this->m_feature.AddString((LPCTSTR)fujia);
this->m_feature.SetCurSel(0);
this->m_feature.EnableWindow(TRUE);
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
}
void CFeaturemodelingDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CFeaturemodelingDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CFeaturemodelingDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CFeaturemodelingDlg::OnDisplay()
{
// TODO: Add your control notification handler code here
CString m_getstring;
int icount;
UpdateData(TRUE);
this->m_feature.GetLBText(m_feature.GetCurSel(),m_getstring);
this->m_sfeature.ResetContent();
if(m_getstring==(CString)pan)
{
for(icount=0;icount<1;icount++)
this->m_sfeature.AddString((LPSTR)lunpan[icount]);
this->m_sfeature.SetCurSel(0);
}
if(m_getstring==(CString)cao)
{
for(icount=0;icount<5;icount++)
this->m_sfeature.AddString((LPSTR)suncao[icount]);
this->m_sfeature.SetCurSel(0);
}
if(m_getstring==(CString)bian)
{
for(icount=0;icount<6;icount++)
this->m_sfeature.AddString((LPSTR)anzhuangbian[icount]);
this->m_sfeature.SetCurSel(0);
}
if(m_getstring==(CString)fujia)
{
for(icount=0;icount<7;icount++)
this->m_sfeature.AddString((LPSTR)fujiajiegou[icount]);
this->m_sfeature.SetCurSel(0);
}
}
void CFeaturemodelingDlg::OnOk()
{
// TODO: Add your control notification handler code here
CString sfeature;
this->m_sfeature.GetText(m_sfeature.GetCurSel(),sfeature);
if(m_sfeature==(CString)lunpan[0])
{Clunpandlg dlg;
dlg.DoModal();
}
}
void CFeaturemodelingDlg::OnCancel()
{
// TODO: Add your control notification handler code here
}
本人刚刚入门,请求高手指点啊