77范文网 - 专业文章范例文档资料分享平台

C语言实训报告 学分管理系统(4)

来源:网络收集 时间:2018-12-29 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

rect10.left=170; rect11.top=70;//设置矩形框的属性 rect11.right=270; rect11.bottom=90; rect11.left=250; rect12.top=70;//设置矩形框的属性 rect12.right=350; rect12.bottom=90; rect12.left=330; DrawText(hDC,\姓名:\ DrawText(hDC,\班级:\ DrawText(hDC,\学号:\ DrawText(hDC,\入学时间:\ DrawText(hDC,\基础课学分:\ DrawText(hDC,\专业课学分:\ DrawText(hDC,\选修课学分:\ DrawText(hDC,\人文类课程学分:\ DrawText(hDC,\实验类课程学分:\ DrawText(hDC,\年\ DrawText(hDC,\月\ DrawText(hDC,\日\ EndPaint(hWnd,&paint); return 0; case WM_CREATE: //响应窗口的创建事件 inputHwnd1 = CreateWindow( TEXT(\NULL,WS_CHILD | WS_VISIBLE | WS_BORDER |ES_LEFT | ES_MULTILINE , 110, 20, 240, 20, hWnd, (HMENU)1, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd2 = CreateWindow( TEXT(\NULL,WS_CHILD | WS_VISIBLE | WS_BORDER |ES_LEFT | ES_MULTILINE , 600, 20, 240, 20, hWnd, (HMENU)2, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd3 = CreateWindow( TEXT(\NULL,WS_CHILD | WS_VISIBLE | WS_BORDER |ES_LEFT | ES_MULTILINE , 1060, 20, 240, 20, hWnd, (HMENU)3, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd4 = CreateWindow( TEXT(\NULL,WS_CHILD | WS_VISIBLE |

16

WS_BORDER |ES_RIGHT | ES_MULTILINE , 110, 70, 60, 20, hWnd, (HMENU)4, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd5 = CreateWindow( TEXT(\NULL,WS_CHILD | WS_VISIBLE | WS_BORDER |ES_LEFT | ES_MULTILINE , 600, 70, 240, 20, hWnd, (HMENU)5, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd6 = CreateWindow( TEXT(\NULL,WS_CHILD | WS_VISIBLE | WS_BORDER |ES_LEFT | ES_MULTILINE , 1060, 70, 240, 20, hWnd, (HMENU)6, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd7 = CreateWindow( TEXT(\NULL,WS_CHILD | WS_VISIBLE | WS_BORDER |ES_LEFT | ES_MULTILINE , 110, 120, 240, 20, hWnd, (HMENU)7, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd8 = CreateWindow( TEXT(\NULL,WS_CHILD | WS_VISIBLE | WS_BORDER |ES_LEFT | ES_MULTILINE , 600, 120, 240, 20, hWnd, (HMENU)8, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd9 = CreateWindow( TEXT(\NULL,WS_CHILD | WS_VISIBLE | WS_BORDER |ES_LEFT | ES_MULTILINE , 1060, 120, 240, 20, hWnd, (HMENU)9, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd10 = CreateWindow( TEXT(\ | WS_BORDER |ES_LEFT | ES_MULTILINE , 20, 180, 1280, 400, hWnd, (HMENU)10, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd11 = CreateWindow( TEXT(\| WS_VISIBLE | WS_BORDER |ES_RIGHT | ES_MULTILINE , 190, 70, 60, 20, hWnd, (HMENU)11, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ; inputHwnd12 = CreateWindow( TEXT(\ | WS_BORDER |ES_RIGHT | ES_MULTILINE , 270, 70, 60, 20, hWnd, (HMENU)12, ((LPCREATESTRUCT) lParam) -> hInstance,NULL ) ;

hwndbutton13=CreateWindow(TEXT(\保存\-> hInstance,NULL);

hwndbutton14=CreateWindow(TEXT(\查询学分\-> hInstance,NULL);

hwndbutton15=CreateWindow(TEXT(\修改学分\-> hInstance,NULL);

hwndbutton16=CreateWindow(TEXT(\删除学生\-> hInstance,NULL);

hwndbutton17=CreateWindow(TEXT(\显示所有可以毕业的学生\lParam) -> hInstance,NULL);

hwndbutton18=CreateWindow(TEXT(\显示所有学生信息\

17

lParam) -> hInstance,NULL);

hwndbutton19=CreateWindow(TEXT(\清空文本\lParam) -> hInstance,NULL); return 0 ; case WM_COMMAND://响应命令 { switch(LOWORD(wParam)) { case 13: clearcache(); baocun(); return 0; case 14: clearcache(); seexuefen(); return 0; case 15: clearcache(); xiugaixuefen(); return 0; case 16: clearcache(); deletestudent(); return 0; case 17: clearcache(); cleartext(); showbiye(); return 0; case 18: clearcache(); cleartext(); showall(); return 0; case 19: clearcache(); cleartext(); return 0; } return 0; }

case WM_DESTROY://如果是点击关闭窗口时的消息 PostQuitMessage(0);//退出消息队列

18

return 0;//返回0,结束函数 } //如果是其余的消息,调用默认消息处理函数,将消息该函数处理并将返回值返回 return DefWindowProc(hWnd,Msg,wParam,lParam); }

void clearcache() //清空缓存 { ZeroMemory(str1,sizeof(str1)); ZeroMemory(str2,sizeof(str2)); ZeroMemory(str3,sizeof(str3)); ZeroMemory(str4,sizeof(str4)); ZeroMemory(str5,sizeof(str5)); ZeroMemory(str6,sizeof(str6)); ZeroMemory(str7,sizeof(str7)); ZeroMemory(str8,sizeof(str8)); ZeroMemory(str9,sizeof(str9)); ZeroMemory(str10,sizeof(str10)); ZeroMemory(str11,sizeof(str11)); ZeroMemory(str12,sizeof(str12)); ZeroMemory(str13,sizeof(str13)); ZeroMemory(str14,sizeof(str14)); }

void cleartext() //清空文本框 { SetDlgItemText(hWnd,1,str4); SetDlgItemText(hWnd,2,str4); SetDlgItemText(hWnd,3,str4); SetDlgItemText(hWnd,4,str4); SetDlgItemText(hWnd,5,str4); SetDlgItemText(hWnd,6,str4); SetDlgItemText(hWnd,7,str4); SetDlgItemText(hWnd,8,str4); SetDlgItemText(hWnd,9,str4); SetDlgItemText(hWnd,10,str4); SetDlgItemText(hWnd,11,str4); SetDlgItemText(hWnd,12,str4); }

void baocun() //保存 { struct student *newstudent; newstudent=new student; GetDlgItemText(hWnd,3,str1,sizeof(str1)/sizeof(char)); newstudent->xuehao=atol(str1); if(newstudent->xuehao==0)

19

{ MessageBox(NULL,TEXT(\保存失败!您输入的学号不合法,请检查学号是否正确!\提示\ delete newstudent; } else { while(assistp!=NULL && assistp->xuehao!=newstudent->xuehao) { assistp=assistp->next; } if(assistp==NULL) { GetDlgItemText(hWnd,1,newstudent->name,sizeof(str1)/sizeof(char)); GetDlgItemText(hWnd,2,newstudent->banji,sizeof(str1)/sizeof(char)); GetDlgItemText(hWnd,4,str5,sizeof(str1)/sizeof(char)); GetDlgItemText(hWnd,5,str6,sizeof(str1)/sizeof(char)); GetDlgItemText(hWnd,6,str7,sizeof(str1)/sizeof(char)); GetDlgItemText(hWnd,7,str8,sizeof(str1)/sizeof(char)); GetDlgItemText(hWnd,8,str9,sizeof(str1)/sizeof(char)); GetDlgItemText(hWnd,9,str10,sizeof(str1)/sizeof(char)); GetDlgItemText(hWnd,11,str11,sizeof(str1)/sizeof(char)); GetDlgItemText(hWnd,12,str13,sizeof(str1)/sizeof(char)); newstudent->year=atoi(str5); newstudent->jichu=atoi(str6); newstudent->zhuanye=atoi(str7); newstudent->xuanxiu=atoi(str8); newstudent->renwen=atoi(str9); newstudent->shiyan=atoi(str10); newstudent->month=atoi(str11); newstudent->date=atoi(str13); newstudent->next=NULL; if(newstudent->year<1999 || newstudent->year>2014 || newstudent->month<1 || newstudent->month>12 || newstudent->date<1 || newstudent->date>31) { MessageBox(NULL,TEXT(\保存失败!您输入的入学时间超出范围,请注意入学时间的范围为1999年1月1日至2014年12月31日,请检查更正后再保存!\提示\ delete newstudent; } else if(newstudent->jichu<0 || newstudent->jichu>100 || newstudent->zhuanye<0 || newstudent->zhuanye>100 || newstudent->xuanxiu<0 || newstudent->xuanxiu>100 || newstudent->renwen<0 || newstudent->renwen>100 || newstudent->shiyan<0 || newstudent->shiyan>100)

20

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库C语言实训报告 学分管理系统(4)在线全文阅读。

C语言实训报告 学分管理系统(4).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/395688.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: