1、 定义?应|用程序的类行D为a。stdafx.hRecommend.hRecommendDlg.h#ifdef _DEBUG#define new DEBUG_NEW/ CRecommendAppBEGIN_MESSAGE_MAP(CRecommendApp, CWinApp) ON_COMMAND(ID_HELP, &CWinApp:OnHelp)END_MESSAGE_MAP()/ CRecommendApp 构造CRecommendApp:CRecommendApp() / 支持重新启动管理器 m_dwRestartManagerSupportFlags = AFX_RESTART_MA
2、NAGER_SUPPORT_RESTART; / TODO: 在此处添加构造代码 / 将?所有D重?要a的初?始化放置?在 InitInstance 中D/ 唯一个? CRecommendApp 对?象CRecommendApp theApp;/ CRecommendApp 构1造 / 支持?重?新?启?动管理器 在此处|添加构1造代码?,/ CRecommendApp 初?BOOL CRecommendApp:InitInstance() / 如果?运?行D在 Windows XP 上清?单指?定a / 使1用 ComCtl32.dll 版本 6 或更高?版来用可视方式 /则需a InitC
3、ommonControlsEx()。否则将?无T法创建窗口。 INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls);它设为a包括D要a在中D使 / 公?共2控?件t类 InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp:InitInstance(); AfxEnableControlContainer(); / 创 shell 管以防对?话框包含? / 任何? shell 树图控?件t或 shell 列D表
4、件t。 CShellManager *pShellManager = new CShellManager; / 标准未使这a些?功|能并希望减?小? / 最终?执行D文?件t的大|移除y下?列D / 不?特例y程 / 更改?于存储注册表项? 应|适当修T改?该?字符串 / 例y如为a公?司?或组织名? SetRegistryKey(_T(向导生成地); CRecommendDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse = IDOK) / TODO:|理时 / “确”关?闭 else if
5、 (nResponse = IDCANCEL)取消? / 删除y上面? if (pShellManager != NULL) delete pShellManager; / 由已返回? FALSE 以便退出? / 而?不?是息泵 return FALSE;RecommendDlg.h/ RecommendDlg.h : 头文?件tafxwin.hafxcmn.hiostreamfstreamsstreamstdio.hafx.htime.hsys/timeb.hctimemath.huser.hWindows.h/ CRecommendDlg 对?class CRecommendDlg : p
6、ublic CDialogEx/ 构1造 CRecommendDlg(CWnd* pParent = NULL);函数y/ 对?y据Y enum IDD = IDD_RECOMMEND_DIALOG ; protected: virtual void DoDataExchange(CDataExchange* pDX); / DDX/DDV 支/ 实现?protected: HICON m_hIcon; / 生映3射 virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg
7、void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); void DisPlay(CString str); CString file_str; CEdit m_Edit_Dis; CListCtrl m_CListCtrl; int num; CString STR; string str; newstj *TJtemp,*TJhead; newsdy *DYtemp,*DYhead; user *temp,*head; user *Ctemp,*Chead; news *ntemp,*nhead; afx_msg void OnBnClicke
8、dBtnList(); afx_msg void OnBnClickedBtnSum(); afx_msg void OnBnClickedBtnOut(); afx_msg void OnBnClickedBtnOpen(); afx_msg void OnBnClickedBtnC(); afx_msg void OnBnClickedBtn(); afx_msg void OnBnClickedBtnNt(); afx_msg void OnBnClickedBtnChosen(); afx_msg void OnBnClickedBtnSt(); afx_msg void OnEnCh
9、angeEditDis(); static UINT Thread(LPVOID lpParam); static UINT Thread_T(LPVOID lpParam); static UINT Thread_O(LPVOID lpParam); static UINT Thread_C(LPVOID lpParam); long long time; struct timeb t1; struct timeb t2; CString strTime; CSliderCtrl m_CSliderCtrl; afx_msg void OnBnClickedBtnSure();Recomme
10、ndDlg.cpp/ RecommendDlg.cpp : 实afxdialogex.h/ 用“菜? CAboutDlg 对?CWinThread* pThread;CWinThread* pThread_t;CWinThread* pThread_o;CWinThread* pThread_c;UINT CRecommendDlg:Thread(LPVOID lpParam)/接受死循-环线? CRecommendDlg *p=(CRecommendDlg*)lpParam; ifstream file(p-file_str);/读入步?相 p-DisPlay(CString(功|打开ast
11、ep_correlation,路径?+p-file_str); ftime(&p-t1); int js=0; while(getline(file,p-str) stringstream ss(p-str); string sub_str; int i=0; while(getline(ss,sub_str,t) if(i=0) p-TJtemp=p-TJhead; for(;TJtemp-next) if(p-newsid=) break; else if(p-newsid=sub_str) break; i=1; elseDYtemp=p-NDYnext;DYtemp- p-newsid
12、=sub_str;times+;next=new newsdy; p- i=0; js+;t2); file.close();STR.Format(%d,js);strTime.Format(%lldms,p-t2.time*1000-p-t1.time*1000);读完.共2读STR+记?录?,耗?strTime); return 0;Thread_T(LPVOID lpParam)/接 ifstream fileuser(p-户最后访问开auser_list,路 while(getline(fileuser,p-temp-userid=sub_str; if(i=1) p-next=new
13、 user;temp=p-next; i=0; p- fileuser.close();t1.time*1000+p-t2.millitm-p-t1.millitm);head;开a始计?算? for(; if(p-userid= break; for(;next) if(p-newsid=p-newsid|p- break; int sum=0,sum1=0;timesm_CSliderCtrl.GetPos() if(sum1times) if(sum sum1=sum; sum=p-times;res1=p-res;res=p-newsid; sum1=p-t=sum;t1=sum1;%llds,共2耗?Thread_O(LPVOID lpParam)/接 ofstream fout(c:/out.csv);正y在输,路 fout for(; if(p-newsid) break; int k=atoi(p-cs.c_str(); int l=atoi(p-cs_.c_str(); if(k!=0&l10)res!= foutuserid,rest-p-t1)/p-tres)
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2