error C2666: '+' : 4 overloads have similar conversions Error executing cl.exe.
答案:1 悬赏:20 手机版
解决时间 2021-03-28 22:28
- 提问者网友:火车头
- 2021-03-28 00:16
error C2666: '+' : 4 overloads have similar conversions Error executing cl.exe.
最佳答案
- 五星知识达人网友:轮獄道
- 2021-03-28 00:32
/ SellListEditDlg.cpp : implementation file//
#include "stdafx.h"#include "StoreSystem.h"#include "SellListEditDlg.h"#include "SellDlg.h"#include "ADOConn.h"#include "Global.h"extern bool Flag;
#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif
这个错误是什么引起的?
/////////////////////////////////////////////////////////////////////////////// CSellListEditDlg dialog
CSellListEditDlg::CSellListEditDlg(CWnd* pParent ) : CDialog(CSellListEditDlg::IDD, pParent){ //{{AFX_DATA_INIT(CSellListEditDlg) m_name = _T(""); m_time = _T(""); m_id = 0; m_num = 0; m_price = 0; //}}AFX_DATA_INIT}
void CSellListEditDlg::DoDataExchange(CDataExchange* pDX){ CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CSellListEditDlg) DDX_Control(pDX, IDC_CLIENT_COMBO, m_Client_Combo); DDX_Text(pDX, IDC_name, m_name); DDX_Text(pDX, IDC_time, m_time); DDX_Text(pDX, IDC_id, m_id); DDX_Text(pDX, IDC_num, m_num); DDX_Text(pDX, IDC_price, m_price); //}}AFX_DATA_MAP}
BEGIN_MESSAGE_MAP(CSellListEditDlg, CDialog) //{{AFX_MSG_MAP(CSellListEditDlg) //}}AFX_MSG_MAPEND_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////// CSellListEditDlg message handlers
BOOL CSellListEditDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE}
void CSellListEditDlg::OnOK() { //Á¬½ÓÊý¾Ý¿â ADOConn m_AdoConn; m_AdoConn.OnInitADOConn(); //ÉèÖÃDELETEÓï¾ä _bstr_t vSQL; UpdateData(); CString strPid,strPprice,strPnum,strPSum; strPid.Format("%d", m_id); strPprice.Format("%d", m_price); strPnum.Format("%d", m_num); strPSum.Format("%d", m_num*m_price); if(Flag) { vSQL = "INSERT INTO Sell (Pid, Pname, Pprice, Pnum, Pclient, Psum, Selltime) VALUES('" + strPid + "'," + m_name + ",'" + strPprice + "','" + strPnum + "','" + "SS" + "','" + strPSum + "','" + m_time + "')"; } else { vSQL = "UPDATE Sell SET Pid=" + strPid + ", Pname='" + m_name + "', Pprice=" + strPprice + ", Pnum=" + strPnum + ",Psum=" + strPSum + ", Selltime='" + m_time + "', WHERe Pid=" + m_id; } m_AdoConn.ExecuteSQL(vSQL); //¶Ï¿ªÓëÊý¾Ý¿âµÄÁ¬½Ó m_AdoConn.ExitConnect(); CDialog::OnOK();
}
#include "stdafx.h"#include "StoreSystem.h"#include "SellListEditDlg.h"#include "SellDlg.h"#include "ADOConn.h"#include "Global.h"extern bool Flag;
#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif
这个错误是什么引起的?
/////////////////////////////////////////////////////////////////////////////// CSellListEditDlg dialog
CSellListEditDlg::CSellListEditDlg(CWnd* pParent ) : CDialog(CSellListEditDlg::IDD, pParent){ //{{AFX_DATA_INIT(CSellListEditDlg) m_name = _T(""); m_time = _T(""); m_id = 0; m_num = 0; m_price = 0; //}}AFX_DATA_INIT}
void CSellListEditDlg::DoDataExchange(CDataExchange* pDX){ CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CSellListEditDlg) DDX_Control(pDX, IDC_CLIENT_COMBO, m_Client_Combo); DDX_Text(pDX, IDC_name, m_name); DDX_Text(pDX, IDC_time, m_time); DDX_Text(pDX, IDC_id, m_id); DDX_Text(pDX, IDC_num, m_num); DDX_Text(pDX, IDC_price, m_price); //}}AFX_DATA_MAP}
BEGIN_MESSAGE_MAP(CSellListEditDlg, CDialog) //{{AFX_MSG_MAP(CSellListEditDlg) //}}AFX_MSG_MAPEND_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////// CSellListEditDlg message handlers
BOOL CSellListEditDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE}
void CSellListEditDlg::OnOK() { //Á¬½ÓÊý¾Ý¿â ADOConn m_AdoConn; m_AdoConn.OnInitADOConn(); //ÉèÖÃDELETEÓï¾ä _bstr_t vSQL; UpdateData(); CString strPid,strPprice,strPnum,strPSum; strPid.Format("%d", m_id); strPprice.Format("%d", m_price); strPnum.Format("%d", m_num); strPSum.Format("%d", m_num*m_price); if(Flag) { vSQL = "INSERT INTO Sell (Pid, Pname, Pprice, Pnum, Pclient, Psum, Selltime) VALUES('" + strPid + "'," + m_name + ",'" + strPprice + "','" + strPnum + "','" + "SS" + "','" + strPSum + "','" + m_time + "')"; } else { vSQL = "UPDATE Sell SET Pid=" + strPid + ", Pname='" + m_name + "', Pprice=" + strPprice + ", Pnum=" + strPnum + ",Psum=" + strPSum + ", Selltime='" + m_time + "', WHERe Pid=" + m_id; } m_AdoConn.ExecuteSQL(vSQL); //¶Ï¿ªÓëÊý¾Ý¿âµÄÁ¬½Ó m_AdoConn.ExitConnect(); CDialog::OnOK();
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯