您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > VisualC++ MFC简要介绍英文原文以及翻译
计算机专业毕业设计外文翻译VisualC++MFC简要介绍工学部工学一部专业计算机科学与技术班级4418101学号200413181038姓名张为指导教师史俊负责教师沈阳航空工业学院北方科技学院2008年7月沈阳航空工业学院北方科技学院毕业设计(外文翻译)1IntroductiontoMFCProgrammingwithVisualC++Version6.xbyMarshallBrainVisualC++ismuchmorethanacompiler.Itisacompleteapplicationdevelopmentenvironmentthat,whenusedasintended,letsyoufullyexploittheobjectorientednatureofC++tocreateprofessionalWindowsapplications.Inordertotakeadvantageofthesefeatures,youneedtounderstandtheC++programminglanguage.IfyouhaveneverusedC++,pleaseturntotheC++tutorialsintheC/C++Tutorialspageforanintroduction.YoumustthenunderstandtheMicrosoftFoundationClass(MFC)hierarchy.ThisclasshierarchyencapsulatestheuserinterfaceportionoftheWindowsAPI,andmakesitsignificantlyeasiertocreateWindowsapplicationsinanobjectorientedway.ThishierarchyisavailableforandcompatiblewithallversionsofWindows.ThecodeyoucreateinMFCisextremelyportable.ThesetutorialsintroducethefundamentalconceptsandvocabularybehindMFCandeventdrivenprogramming.Inthistutorialyouwillenter,compile,andrunasimpleMFCprogramusingVisualC++.Tutotial2providesadetailedexplanationofthecodeusedinTutorial1.Tutorial3discussesMFCcontrolsandtheircustomization.Tutorial4coversmessagemaps,whichletyouhandleeventsinMFC.WhatistheMicrosoftFoundationsClassLibrary?Let'ssayyouwanttocreateaWindowsapplication.Youmight,forexample,needtocreateaspecializedtextordrawingeditor,oraprogramthatfindsfilesonalargeharddisk,oranapplicationthatletsauservisualizetheinterrelationshipsinabigdataset.Wheredoyoubegin?Agoodstartingplaceisthedesignoftheuserinterface.First,decidewhattheusershouldbeabletodowiththeprogramandthenpickasetofuserinterfaceobjectsaccordingly.TheWindowsuserinterfacehasanumberofstandardcontrols,suchasbuttons,menus,scrollbars,andlists,thatarealreadyfamiliartoWindowsusers.Withthisinmind,theprogrammermustchooseasetofcontrolsanddecidehowtheyshouldbearrangedonscreen.Atime-honoredprocedureistomakearoughsketchoftheproposeduserinterface(bytraditiononanapkinorthebackofanenvelope)andplaywiththeelementsuntiltheyfeelright.Forsmallprojects,orfortheearlyprototypingphaseofalargerproject,thisissufficient.Thenextstepistoimplementthecode.WhencreatingaprogramforanyWindows沈阳航空工业学院北方科技学院毕业设计(外文翻译)2platform,theprogrammerhastwochoices:CorC++.WithC,theprogrammercodesattheleveloftheWindowsApplicationProgramInterface(API).ThisinterfaceconsistsofacollectionofhundredsofCfunctionsdescribedintheWindow'sAPIReferencebooks.ForWindow'sNT,theAPIistypicallyreferredtoastheWin32API,todistinguishitfromtheoriginal16-bitAPIoflower-levelWindowsproductslikeWindows3.1.MicrosoftalsoprovidesaC++librarythatsitsontopofanyoftheWindowsAPIsandmakestheprogrammer'sjobeasier.CalledtheMicrosoftFoundationClasslibrary(MFC),thislibrary'sprimaryadvantageisefficiency.ItgreatlyreducestheamountofcodethatmustbewrittentocreateaWindowsprogram.ItalsoprovidesalltheadvantagesnormallyfoundinC++programming,suchasinheritanceandencapsulation.MFCisportable,sothat,forexample,codecreatedunderWindows3.1canmovetoWindowsNTorWindows95veryeasily.MFCisthereforethepreferredmethodfordevelopingWindowsapplicationsandwillbeusedthroughoutthesetutorials.WhenyouuseMFC,youwritecodethatcreatesthenecessaryuserinterfacecontrolsandcustomizestheirappearance.Youalsowritecodethatrespondswhentheusermanipulatesthesecontrols.Forexample,iftheuserclicksabutton,youwanttohavecodeinplacethatrespondsappropriately.Itisthissortofevent-handlingcodethatwillformthebulkofanyapplication.Oncetheapplicationrespondscorrectlytoalloftheavailablecontrols,itisfinished.YoucanseefromthisdiscussionthatthecreationofaWindowsprogramisastraightforwardprocesswhenusingMFC.Thegoalofthesetutorialsistofillinthedetailsandtoshowthetechniquesyoucanusetocreateprofessionalapplicationsasquicklyaspossible.TheVisualC++applicationdevelopmentenvironmentisspecificallytunedtoMFC,sobylearningMFCandVisualC++togetheryoucansignificantlyincreaseyourpowerasanapplicationdeveloper.WindowsVocabularyThevocabularyusedtotalkaboutuserinterfacefeaturesandsoftwaredevelopmentinWindowsisbasicbutunique.Herewereviewafewdefinitionstomakediscussioneasierforthosewhoarenewtotheenvironment.Windowsapplicationsuseseveralstandardusercontrols:StatictextlabelsPushbuttons沈阳航空工业学院北方科技学院毕业设计(外文翻译)3ListboxesComboboxes(amoreadvancedformoflist)RadioboxesCheckboxesEditabletextareas(singleandmulti-line)ScrollbarsYoucancreatethesecontrolseitherincodeorthrougharesourceeditorthatcancreatedialogsandthecontrolsinsideofthem.Inthissetoftutorialswewillexaminehowtocreatethemincode.SeethetutorialsontheAppWizardandClassWizardforanintroductiontotheresourceeditorfordialogs.Windowssupportsseveraltypesofapplicationwindows.Atypicalapplicationwillliveinsideaframewindow.Aframewindowisafullyfeaturedmainwindowthattheusercanre-size,minimize,maximizetofillthescreen,andsoon.Windowsalsosupportstwotypesofdialogboxes:modalandmodeless.Amodaldialogbox,onceonthescreen,blocksinputtotherestoftheapplicationuntilitisanswered.Amodelessdialogboxcanappearatthesametimeastheapplicationandseemstofloataboveittokeepfrombeingoverlaid.MostsimpleWindowsapplicati
本文标题:VisualC++ MFC简要介绍英文原文以及翻译
链接地址:https://www.777doc.com/doc-5596188 .html