⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wuzhou11dlg.cpp

📁 人工神经网络c++源代码可以直接利用或学习,希望有帮助
💻 CPP
📖 第 1 页 / 共 2 页
字号:
// wuzhou11Dlg.cpp : implementation file
//
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
#include <string.h>
#include <conio.h>
#include <ctype.h>
#include <math.h>
#include <fstream.h>
#include <iomanip.h>
#include <process.h>
#include <malloc.h>
//
#include "stdafx.h"
#include "wuzhou11.h"
#include "wuzhou11Dlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
	int xx1=0,xx2=0,xx3=0,xx4=0,xx5=0;
	float xx6=0.0,xx7=0.0,xx8=0.0,xx9=0.0,xx10=0.0;
	float xx11=0.0,xx12=0.0,xx13=0.0,xx14=0.0,xx15=0.0;
	float xx16=0.0,xx17=0.0,xx18=0.0,xx19=0.0,xx20=0.0;
	int tmp1=0,
		tmp2=0,
		tmp3=0,
		tmp4=0,
		tmp5=0;
	double 
		tmp6=0.0,
		tmp7=0.0,
		tmp8=0.0,
		tmp9=0.0,
		tmp10=0.0;
	double 
		tmp11=0.0,
		tmp12=0.0,
		tmp13=0.0,
		tmp14=0.0,
		tmp15=0.0;
	double 
		tmp16=0.0,
		tmp17=0.0,
		tmp18=0.0,
		tmp19=0.0,
		tmp20=0.0;

	char buffer[50];
    char tmp;
//	char name[50];
    char name[50];
	char yy[5];
//
//

//	char yynn;
/////////////////////////////////////////////////////////////////////////////
// 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()

/////////////////////////////////////////////////////////////////////////////
// CWuzhou11Dlg dialog

CWuzhou11Dlg::CWuzhou11Dlg(CWnd* pParent /*=NULL*/)
	: CDialog(CWuzhou11Dlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CWuzhou11Dlg)
	m_edit1 = 0;
	m_edit2 = 0;
	m_edit3 = 0;
	m_edit4 = 0;
	m_edit5 = 0;
	m_edit7 = _T("");
	m_edit8 = _T("");
	m_edit9 = _T("");
	m_edit6 = _T("");
	m_edit10 = _T("");
	m_edit11 = _T("");
	m_edit12 = _T("");
	m_edit13 = _T("");
	m_edit14 = _T("");
	m_edit15 = _T("");
	m_edit16 = _T("");
	m_edit17 = _T("");
	m_edit18 = _T("");
	m_edit19 = _T("");
	m_edit20 = _T("");
	m_edit21 = _T("");
	m_edit22 = _T("");
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CWuzhou11Dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CWuzhou11Dlg)
	DDX_Control(pDX, IDC_EDIT12, m_pEdit12);
	DDX_Control(pDX, IDC_EDIT22, m_pEdit22);
	DDX_Control(pDX, IDC_EDIT21, m_pEdit21);
	DDX_Control(pDX, IDC_EDIT20, m_pEdit20);
	DDX_Control(pDX, IDC_EDIT19, m_pEdit19);
	DDX_Control(pDX, IDC_EDIT18, m_pEdit18);
	DDX_Control(pDX, IDC_EDIT17, m_pEdit17);
	DDX_Control(pDX, IDC_EDIT16, m_pEdit16);
	DDX_Control(pDX, IDC_EDIT15, m_pEdit15);
	DDX_Control(pDX, IDC_EDIT14, m_pEdit14);
	DDX_Control(pDX, IDC_EDIT13, m_pEdit13);
	DDX_Control(pDX, IDC_EDIT11, m_pEdit11);
	DDX_Control(pDX, IDC_EDIT10, m_pEdit10);
	DDX_Control(pDX, IDC_EDIT9, m_pEdit9);
	DDX_Control(pDX, IDC_EDIT8, m_pEdit8);
	DDX_Control(pDX, IDC_EDIT7, m_pEdit7);
	DDX_Control(pDX, IDC_EDIT6, m_pEdit6);
	DDX_Control(pDX, IDC_EDIT5, m_pEdit5);
	DDX_Control(pDX, IDC_EDIT4, m_pEdit4);
	DDX_Control(pDX, IDC_EDIT3, m_pEdit3);
	DDX_Control(pDX, IDC_EDIT2, m_pEdit2);
	DDX_Control(pDX, IDC_EDIT1, m_pEdit1);
	DDX_Text(pDX, IDC_EDIT1, m_edit1);
	DDV_MinMaxInt(pDX, m_edit1, 0, 100000000);
	DDX_Text(pDX, IDC_EDIT2, m_edit2);
	DDV_MinMaxInt(pDX, m_edit2, 0, 100000000);
	DDX_Text(pDX, IDC_EDIT3, m_edit3);
	DDV_MinMaxInt(pDX, m_edit3, 0, 100000000);
	DDX_Text(pDX, IDC_EDIT4, m_edit4);
	DDV_MinMaxInt(pDX, m_edit4, 0, 100000000);
	DDX_Text(pDX, IDC_EDIT5, m_edit5);
	DDV_MinMaxInt(pDX, m_edit5, 0, 100000000);
	DDX_Text(pDX, IDC_EDIT7, m_edit7);
	DDV_MaxChars(pDX, m_edit7, 50);
	DDX_Text(pDX, IDC_EDIT8, m_edit8);
	DDV_MaxChars(pDX, m_edit8, 50);
	DDX_Text(pDX, IDC_EDIT9, m_edit9);
	DDV_MaxChars(pDX, m_edit9, 50);
	DDX_Text(pDX, IDC_EDIT6, m_edit6);
	DDV_MaxChars(pDX, m_edit6, 50);
	DDX_Text(pDX, IDC_EDIT10, m_edit10);
	DDV_MaxChars(pDX, m_edit10, 50);
	DDX_Text(pDX, IDC_EDIT11, m_edit11);
	DDV_MaxChars(pDX, m_edit11, 50);
	DDX_Text(pDX, IDC_EDIT12, m_edit12);
	DDV_MaxChars(pDX, m_edit12, 50);
	DDX_Text(pDX, IDC_EDIT13, m_edit13);
	DDV_MaxChars(pDX, m_edit13, 50);
	DDX_Text(pDX, IDC_EDIT14, m_edit14);
	DDV_MaxChars(pDX, m_edit14, 50);
	DDX_Text(pDX, IDC_EDIT15, m_edit15);
	DDV_MaxChars(pDX, m_edit15, 50);
	DDX_Text(pDX, IDC_EDIT16, m_edit16);
	DDV_MaxChars(pDX, m_edit16, 50);
	DDX_Text(pDX, IDC_EDIT17, m_edit17);
	DDV_MaxChars(pDX, m_edit17, 50);
	DDX_Text(pDX, IDC_EDIT18, m_edit18);
	DDV_MaxChars(pDX, m_edit18, 50);
	DDX_Text(pDX, IDC_EDIT19, m_edit19);
	DDV_MaxChars(pDX, m_edit19, 50);
	DDX_Text(pDX, IDC_EDIT20, m_edit20);
	DDV_MaxChars(pDX, m_edit20, 50);
	DDX_Text(pDX, IDC_EDIT21, m_edit21);
	DDV_MaxChars(pDX, m_edit21, 50);
	DDX_Text(pDX, IDC_EDIT22, m_edit22);
	DDV_MaxChars(pDX, m_edit22, 50);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CWuzhou11Dlg, CDialog)
	//{{AFX_MSG_MAP(CWuzhou11Dlg)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
	ON_EN_CHANGE(IDC_EDIT2, OnChangeEdit2)
	ON_EN_CHANGE(IDC_EDIT3, OnChangeEdit3)
	ON_EN_CHANGE(IDC_EDIT4, OnChangeEdit4)
	ON_EN_CHANGE(IDC_EDIT5, OnChangeEdit5)
	ON_EN_CHANGE(IDC_EDIT6, OnChangeEdit6)
	ON_EN_CHANGE(IDC_EDIT7, OnChangeEdit7)
	ON_EN_CHANGE(IDC_EDIT8, OnChangeEdit8)
	ON_EN_CHANGE(IDC_EDIT9, OnChangeEdit9)
	ON_EN_CHANGE(IDC_EDIT10, OnChangeEdit10)
	ON_EN_CHANGE(IDC_EDIT11, OnChangeEdit11)
	ON_EN_CHANGE(IDC_EDIT12, OnChangeEdit12)
	ON_EN_CHANGE(IDC_EDIT13, OnChangeEdit13)
	ON_EN_CHANGE(IDC_EDIT14, OnChangeEdit14)
	ON_EN_CHANGE(IDC_EDIT15, OnChangeEdit15)
	ON_EN_CHANGE(IDC_EDIT16, OnChangeEdit16)
	ON_EN_CHANGE(IDC_EDIT17, OnChangeEdit17)
	ON_EN_CHANGE(IDC_EDIT18, OnChangeEdit18)
	ON_EN_CHANGE(IDC_EDIT19, OnChangeEdit19)
	ON_EN_CHANGE(IDC_EDIT20, OnChangeEdit20)
	ON_EN_CHANGE(IDC_EDIT21, OnChangeEdit21)
	ON_EN_CHANGE(IDC_EDIT22, OnChangeEdit22)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_WM_CTLCOLOR()
	ON_WM_CANCELMODE()
	ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
	ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWuzhou11Dlg message handlers


BOOL CWuzhou11Dlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	//
//	CWinApp color;
//     GetColor(192,192,192);
//    color.SetDialogBkColor(COLORREF clrCtlBk=RGB(192,192,192),
//		             COLORREF clrCtlText=RGB(0,0,0));
	// 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

//	SetDlgItemText(IDC_EDIT6,"xxx");
//



//
//	 OnChangeEdit21(); 
//	 OnChangeEdit22(); 
//
//			strcpy(file1,aa);
		char aa[]={"learn"};
		char yynn[]={"n"};
	       strcpy(file1,aa);
		   strcpy(file0,aa);
			strcpy(yy,yynn);

           str(file1);

		FILE *f2;
		if((f2=fopen(name2,"r+"))==NULL)
		{ 
//			strcpy(name,aa);
//			strcpy(yy,yynn);
		    f2=fopen(name2,"w+");
//			 fprintf(file2,"%s\n %c\n",name,yy);
			 fprintf(f2,"%10d%10d%10d%10d%10d\n",xx1,xx2,xx3,xx4,xx5);
		     fprintf(f2,"%5.2f%5.2f%5.2f%5.2f%5.2f\n",xx6,xx7,xx8,xx9,xx10);	
		     fprintf(f2,"%5.2f%5.2f%5.2f%5.2f%5.2f\n",xx11,xx12,xx13,xx14,xx15);	
		     fprintf(f2,"%5.2f%5.2f%5.2f%5.2f%5.2f\n",xx16,xx17,xx18,xx19,xx20);	
//		  printf("没有打开文件!\n");
//		  exit(0);
		  }
	   else
		 {  
//		   			strcpy(name,aa);
//		   			strcpy(yy,yynn);

//		   			yy[]={"y"};

//		   	fscanf(file2,"%s",name);
//			fscanf(file2,"%s",yy);
		    fscanf(f2,"%d%d%d%d%d",&xx1,&xx2,&xx3,&xx4,&xx5);
		    fscanf(f2,"%f%f%f%f%f",&xx6,&xx7,&xx8,&xx9,&xx10);
		    fscanf(f2,"%f%f%f%f%f",&xx11,&xx12,&xx13,&xx14,&xx15);
		    fscanf(f2,"%f%f%f%f%f",&xx16,&xx17,&xx18,&xx19,&xx20);
//		 
		  }
		  fclose(f2);
//
//		  	

	SetDlgItemInt(IDC_EDIT1,xx1,TRUE);
	SetDlgItemInt(IDC_EDIT2,xx2,TRUE);
	SetDlgItemInt(IDC_EDIT3,xx3,TRUE);
	SetDlgItemInt(IDC_EDIT4,xx4,TRUE);
	SetDlgItemInt(IDC_EDIT5,xx5,TRUE);
//
	    gcvt(xx6,7,buffer);
	SetDlgItemText(IDC_EDIT6,buffer);
    	gcvt(xx7,7,buffer);
	SetDlgItemText(IDC_EDIT7,buffer);
    	gcvt(xx8,7,buffer);
	SetDlgItemText(IDC_EDIT8,buffer);
	    gcvt(xx9,7,buffer);
	SetDlgItemText(IDC_EDIT9,buffer);
    	gcvt(xx10,7,buffer);
	SetDlgItemText(IDC_EDIT10,buffer);
	//
	    gcvt(xx11,7,buffer);
	SetDlgItemText(IDC_EDIT11,buffer);
    	gcvt(xx12,7,buffer);
	SetDlgItemText(IDC_EDIT12,buffer);
    	gcvt(xx13,7,buffer);
	SetDlgItemText(IDC_EDIT13,buffer);
	    gcvt(xx14,7,buffer);
	SetDlgItemText(IDC_EDIT14,buffer);
    	gcvt(xx15,7,buffer);
	SetDlgItemText(IDC_EDIT15,buffer);
//
     	gcvt(xx16,7,buffer);
	SetDlgItemText(IDC_EDIT16,buffer);
    	gcvt(xx17,7,buffer);
	SetDlgItemText(IDC_EDIT17,buffer);
    	gcvt(xx18,7,buffer);
	SetDlgItemText(IDC_EDIT18,buffer);
	    gcvt(xx19,7,buffer);
	SetDlgItemText(IDC_EDIT19,buffer);
    	gcvt(xx20,7,buffer);
	SetDlgItemText(IDC_EDIT20,buffer);

	SetDlgItemText(IDC_EDIT21,file0);
	SetDlgItemText(IDC_EDIT22,yy);

//
//
	return TRUE;  // return TRUE  unless you set the focus to a control
}

void CWuzhou11Dlg::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 CWuzhou11Dlg::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 CWuzhou11Dlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void CWuzhou11Dlg::OnChangeEdit1() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.

	tmp1=(int)GetDlgItemInt(IDC_EDIT1);

//	m_edit1=tmp1;
//	tmp2=tmp1;
//	SetDlgItemInt(IDC_EDIT1,10000,TRUE);
	
	// TODO: Add your control notification handler code here
	
}


void CWuzhou11Dlg::OnChangeEdit2() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	tmp2=(int)GetDlgItemInt(IDC_EDIT2);
	
	// TODO: Add your control notification handler code here
	
}

void CWuzhou11Dlg::OnChangeEdit3() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	tmp3=(int)GetDlgItemInt(IDC_EDIT3);
	
	// TODO: Add your control notification handler code here
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -