ImageVerifierCode 换一换
格式:DOC , 页数:33 ,大小:549.50KB ,
资源ID:6095316      下载积分:10 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.docduoduo.com/d-6095316.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(vc程序设计 英文.doc)为本站会员(cjc2202537)主动上传,道客多多仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知道客多多(发送邮件至docduoduo@163.com或直接QQ联系客服),我们立即给予删除!

vc程序设计 英文.doc

1、VC+ PROJECTECJTUNAME STUDENT IDLIU * 2*LI * 2*DAI * 2*WANG * 2*ZUO * 2*STUDENT CLASS:CLASS 1MAJOR: 2*CertificateThis to certify that the following students:1. Liu *,and Student ID No is 2*2. Li * and Student ID No is 2*3. Dai * and Student ID No is 2*4. Wang * and Student ID No is 2*5. Zuo * and Stu

2、dent ID No is 2*are done this project under the guidance and supervision of MR.RAVI and it is submitted to the East China JiaoTong University as partial fulfillment of Software and Machanic / Overrides/ ClassWizard generated virtual function overrides/AFX_VIRTUAL(CSkyblue_LLKApp)public:virtual BOOL

3、InitInstance();/AFX_VIRTUAL/ Implementation/AFX_MSG(CSkyblue_LLKApp)/ NOTE - the ClassWizard will add and remove member functions here./ DO NOT EDIT what you see in these blocks of generated code !/AFX_MSGDECLARE_MESSAGE_MAP();/AFX_INSERT_LOCATION/ Microsoft Visual C+ will insert additional declarat

4、ions immediately before the previous line.#endif / !defined(AFX_SKYBLUE_LLK_H_A2AA2546_B9F0_4250_9623_03889A3B311A_INCLUDED_)skyblue_LLK.cpp/ skyblue_LLK.cpp : Defines the class behaviors for the application./#include “stdafx.h“#include “skyblue_LLK.h“#include “skyblue_LLKDlg.h“#ifdef _DEBUG#define

5、new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE = _FILE_;#endif/ CSkyblue_LLKAppBEGIN_MESSAGE_MAP(CSkyblue_LLKApp, CWinApp)/AFX_MSG_MAP(CSkyblue_LLKApp)/ NOTE - the ClassWizard will add and remove mapping macros here./ DO NOT EDIT what you see in these blocks of generated code!/AFX_MSGON_COMMAND(

6、ID_HELP, CWinApp:OnHelp)END_MESSAGE_MAP()/ CSkyblue_LLKApp constructionCSkyblue_LLKApp:CSkyblue_LLKApp()/ TODO: add construction code here,/ Place all significant initialization in InitInstance/ The one and only CSkyblue_LLKApp objectCSkyblue_LLKApp theApp;/ CSkyblue_LLKApp initializationBOOL CSkybl

7、ue_LLKApp:InitInstance()AfxEnableControlContainer();/ Standard initialization/ If you are not using these features and wish to reduce the size/ of your final executable, you should remove from the following/ the specific initialization routines you do not need.C_LLK_Dlg dlg;m_pMainWnd = int nRespons

8、e = dlg.DoModal();if (nResponse = IDOK)/ TODO: Place code here to handle when the dialog is/ dismissed with OKelse if (nResponse = IDCANCEL)/ TODO: Place code here to handle when the dialog is/ dismissed with Cancel/ Since the dialog has been closed, return FALSE so that we exit the/ application, ra

9、ther than start the applications message pump.return FALSE;Resource.h/NO_DEPENDENCIES/ Microsoft Developer Studio generated include file./ Used by skyblue_LLK.rc/#define IDD_SKYBLUE_LLK_DIALOG 102#define IDD_LLK_DIALOG 102#define IDR_MAINFRAME 128#define IDB_BMP_ANIMAL 130#define IDB_BITMAP_3D_FRAME

10、S 131/ Next default values for new objects/ #ifdef APSTUDIO_INVOKED#ifndef APSTUDIO_READONLY_SYMBOLS#define _APS_NEXT_RESOURCE_VALUE 132#define _APS_NEXT_COMMAND_VALUE 32771#define _APS_NEXT_CONTROL_VALUE 1000#define _APS_NEXT_SYMED_VALUE 101#endif#endifskyblue_LLKDlg.h/*+Copyright (c) AFE(Active-Fr

11、ee-Elegance)Module Name:skyblue_LLKDlg.hAbstract:LLK-Games kernal-solving DialogAuthor:Weijian Luo (Arthur Luo) 15-Jun-2005E-mail: Revision History: 1.0-*/#if !defined(AFX_SKYBLUE_LLKDLG_H_F043F328_5562_4EEC_921D_508E1DBDC900_INCLUDED_)#define AFX_SKYBLUE_LLKDLG_H_F043F328_5562_4EEC_921D_508E1DBDC90

12、0_INCLUDED_#if _MSC_VER 1000#pragma once#endif / _MSC_VER 1000/ C_LLK_Dlg dialogclass C_LLK_Dlg : public CDialog/ Constructionpublic:/GameDrawvoid GameDraw(CDC * pDC);/StartNewGamevoid StartNewGame();BOOL IsLink(int x1,int y1,int x2,int y2);BOOL IsWin(void);/X=BOOL X1_Link_X2(int x,int y1,int y2);/Y

13、=BOOL Y1_Link_Y2(int x1,int x2,int y);BOOL OneCornerLink(int x1,int y1,int x2,int y2);BOOL TwoCornerLink(int x1,int y1,int x2,int y2);BOOL YThrough(int x,int y,BOOL bAdd);BOOL XThrough(int x,int y,BOOL bAdd);BOOL LineX(int x,int y1,int y2);BOOL LineY(int x1,int x2,int y);C_LLK_Dlg(CWnd* pParent = NU

14、LL);/ standard constructorC_LLK_Dlg();/ Dialog Data/AFX_DATA(CTemp2Dlg)enum IDD = IDD_LLK_DIALOG ;/ NOTE: the ClassWizard will add data members here/AFX_DATA/ ClassWizard generated virtual function overrides/AFX_VIRTUAL(CTemp2Dlg)public:virtual BOOL PreTranslateMessage(MSG* pMsg);protected:virtual v

15、oid DoDataExchange(CDataExchange* pDX); / DDX/DDV support/AFX_VIRTUAL/ Implementationprotected:HICON m_hIcon;CDC m_mem3DBkDC; CBitmap m_mem3DBkBmp; CDC m_memAnimalDC; CBitmap m_memAnimalBmp; CDC m_MemDC; CBitmap m_memBitmap; /地图位置相关属性组int* m_map; int m_nRow; int m_nCol; int m_nX1; int m_nY1; / Gener

16、ated message map functions/AFX_MSG(CTemp2Dlg)virtual BOOL OnInitDialog();afx_msg void OnPaint();afx_msg HCURSOR OnQueryDragIcon();afx_msg void OnLButtonDown(UINT nFlags, CPoint point);/AFX_MSGDECLARE_MESSAGE_MAP();/AFX_INSERT_LOCATION/ Microsoft Visual C+ will insert additional declarations immediat

17、ely before the previous line.#endif / !defined(AFX_SKYBLUE_LLKDLG_H_F043F328_5562_4EEC_921D_508E1DBDC900_INCLUDED_)stdafx.h/ stdafx.h : include file for standard system include files,/ or project specific include files that are used frequently, but/ are changed infrequently/#if !defined(AFX_STDAFX_H

18、_F66DEF85_CF00_4F60_8D9D_B3BBB3169771_INCLUDED_)#define AFX_STDAFX_H_F66DEF85_CF00_4F60_8D9D_B3BBB3169771_INCLUDED_#if _MSC_VER 1000#pragma once#endif / _MSC_VER 1000#define VC_EXTRALEAN / Exclude rarely-used stuff from Windows headers#include / MFC core and standard components#include / MFC extensi

19、ons#include / MFC Automation classes#include / MFC support for Internet Explorer 4 Common Controls#ifndef _AFX_NO_AFXCMN_SUPPORT#include / MFC support for Windows Common Controls#endif / _AFX_NO_AFXCMN_SUPPORT/AFX_INSERT_LOCATION/ Microsoft Visual C+ will insert additional declarations immediately b

20、efore the previous line.#endif / !defined(AFX_STDAFX_H_F66DEF85_CF00_4F60_8D9D_B3BBB3169771_INCLUDED_)skyblue_LLKDlg.cpp/*+Copyright (c) AFE(Active-Free-Elegance)Module Name:skyblue_LLKDlg.cppAbstract:LLK-Games kernal-solving DialogAuthor:Weijian Luo (Arthur Luo) 15-Jun-2005E-mail: Revision History:

21、 1.0-*/#include “stdafx.h“#include “skyblue_LLK.h“#include “skyblue_LLKDlg.h“#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE = _FILE_;#endif/ C_LLK_Dlg dialog#define BKCOLOR RGB(128,128,128)#define FRONTWIDTH (39+2) #define FRONTHEIGHT (39+12) #define BKWIDTH 46#define BKHEIG

22、HT 56#define ROWCOUNT 7#define COLCOUNT 12#define BLANK_STATE -1 / C_LLK_Dlg dialogC_LLK_Dlg:C_LLK_Dlg(CWnd* pParent /*=NULL*/): CDialog(C_LLK_Dlg:IDD, pParent)/AFX_DATA_INIT(C_LLK_Dlg)/ NOTE: the ClassWizard will add member initialization here/AFX_DATA_INIT/ Note that LoadIcon does not require a su

23、bsequent DestroyIcon in Win32m_hIcon = AfxGetApp()-LoadIcon(IDR_MAINFRAME);m_nY1= BLANK_STATE;m_nX1= BLANK_STATE;m_nRow=ROWCOUNT;m_nCol=COLCOUNT;m_map=new intm_nRow*m_nCol;C_LLK_Dlg:C_LLK_Dlg()delete m_map;void C_LLK_Dlg:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pDX);/AFX_DATA_MAP(C_L

24、LK_Dlg)/ NOTE: the ClassWizard will add DDX and DDV calls here/AFX_DATA_MAPBEGIN_MESSAGE_MAP(C_LLK_Dlg, CDialog)/AFX_MSG_MAP(C_LLK_Dlg)ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_WM_LBUTTONDOWN()/AFX_MSG_MAPEND_MESSAGE_MAP()/ C_LLK_Dlg message handlersBOOL C_LLK_Dlg:OnInitDialog()CDialog:OnInitDialog();/ S

25、et the icon for this dialog. The framework does this automatically/ when the applications main window is not a dialogSetIcon(m_hIcon, TRUE); / Set big iconSetIcon(m_hIcon, FALSE); / Set small iconCDC *pWinDC = GetDC();m_mem3DBkDC.CreateCompatibleDC(pWinDC);m_mem3DBkBmp.LoadBitmap(IDB_BITMAP_3D_FRAME

26、S);m_mem3DBkDC.SelectObject(m_memAnimalDC.CreateCompatibleDC(pWinDC);m_memAnimalBmp.LoadBitmap(IDB_BMP_ANIMAL);m_memAnimalDC.SelectObject(m_MemDC.CreateCompatibleDC(pWinDC);m_memBitmap.CreateCompatibleBitmap(pWinDC,m_nCol*FRONTWIDTH+5,m_nRow*FRONTHEIGHT+5);m_MemDC.SelectObject(StartNewGame();HWND hW

27、nd = :AfxGetMainWnd()-m_hWnd;:SetWindowPos(hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);return TRUE; / return TRUE unless you set the focus to a controlvoid C_LLK_Dlg:StartNewGame()for(int iNum=0;iNumFillSolidRect(0,0,m_nCol*FRONTWIDTH+5,m_nRow*FRONTHEIGHT+5,BKCOLOR);for(int i=0;iBitBlt(j*FRONTW

28、IDTH,i*FRONTHEIGHT,BKWIDTH,BKHEIGHT,pDC-BitBlt(j*FRONTWIDTH,i*FRONTHEIGHT,FRONTWIDTH-2,FRONTHEIGHT-12,pDC-BitBlt(j*FRONTWIDTH,i*FRONTHEIGHT,FRONTWIDTH-2,FRONTHEIGHT-12,/ The system calls this to obtain the cursor to display while the user drags/ the minimized window.HCURSOR C_LLK_Dlg:OnQueryDragIcon

29、()return (HCURSOR) m_hIcon;/ 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 C_LLK_Dlg:OnPaint() CPaintDC dc(this); / device context for painting

30、GameDraw(dc.BitBlt(0,0,m_nCol*FRONTWIDTH,m_nCol*FRONTHEIGHT,/void C_LLK_Dlg:OnLButtonDown(UINT nFlags, CPoint point) int x=point.x/FRONTWIDTH+(point.x%FRONTWIDTH?1:0)-1;int y=point.y/FRONTHEIGHT+(point.y%FRONTHEIGHT?1:0)-1;if(xSelectObject(pWinDC-MoveTo(x*FRONTWIDTH,y*FRONTHEIGHT);pWinDC-LineTo(x*FR

31、ONTWIDTH,(y+1)*FRONTHEIGHT);pWinDC-LineTo(x+1)*FRONTWIDTH,(y+1)*FRONTHEIGHT);pWinDC-LineTo(x+1)*FRONTWIDTH,y*FRONTHEIGHT);pWinDC-LineTo(x*FRONTWIDTH,y*FRONTHEIGHT);pWinDC-SelectObject(pOldPen);else if(m_nX1!=x|m_nY1!=y)m_mapy*m_nCol+x=BLANK_STATE;m_nX1=BLANK_STATE; m_nY1=BLANK_STATE;Invalidate(FALSE

32、);if(IsWin()MessageBox(“恭喜您胜利闯关,即将开始新局“);StartNewGame();/BOOL C_LLK_Dlg:X1_Link_X2(int x, int y1,int y2)if(y1y2)int n=y1;y1=y2;y2=n;for(int i=y1+1;ix2)int x=x1;x1=x2;x2=x;for(int i=x1+1;iy2)int y=y1;y1=y2;y2=y;for(int y=y1;yx2)int x=x1;x1=x2;x2=x;for(int x=x1;xx2)int n=x1;x1=x2;x2=n;n=y1;y1=y2;y2=n;

33、if(y2x2)int n=x1;x1=x2;x2=n;n=y1;y1=y2;y2=n;if(XThrough(x1+1,y1,TRUE)if(XThrough(x1-1,y1,FALSE)if(YThrough(x1,y1-1,FALSE)if(YThrough(x1,y1+1,TRUE)for(int x=x1+1;x-1)break;if(OneCornerLink(x,y1,x2,y2)return TRUE;for(x=x1-1;x-1;x-)if(m_mapy1*m_nCol+x!=BLANK_STATE)break;if(OneCornerLink(x,y1,x2,y2)retu

34、rn TRUE;for(int y=y1-1;y-1;y-)if(m_mapy*m_nCol+x1!=BLANK_STATE)break;if(OneCornerLink(x1,y,x2,y2)return TRUE;for(y=y1+1;ym_nRow;y+)if(m_mapy*m_nCol+x1!=BLANK_STATE)break;if(OneCornerLink(x1,y,x2,y2)return TRUE;return FALSE;BOOL C_LLK_Dlg:XThrough(int x, int y, BOOL bAdd)if(bAdd)for(int i=x;im_nCol;i

35、+)if(m_mapy*m_nCol+i!=BLANK_STATE)return FALSE;elsefor(int i=0;i=x;i+)if(m_mapy*m_nCol+i!=BLANK_STATE)return FALSE;return TRUE;BOOL C_LLK_Dlg:YThrough(int x, int y,BOOL bAdd)if(bAdd)for(int i=y;im_nRow;i+)if(m_mapi*m_nCol+x!=BLANK_STATE)return FALSE;elsefor(int i=0;i=y;i+)if(m_mapi*m_nCol+x!=BLANK_STATE)return FALSE;

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报