MFC的考试题英文.docx
《MFC的考试题英文.docx》由会员分享,可在线阅读,更多相关《MFC的考试题英文.docx(24页珍藏版)》请在冰豆网上搜索。
![MFC的考试题英文.docx](https://file1.bdocx.com/fileroot1/2023-1/24/07a32f66-9c47-4643-9d1d-ad676305b5e1/07a32f66-9c47-4643-9d1d-ad676305b5e11.gif)
MFC的考试题英文
MFC的考试题
2001Answer
MasteringMFCFundamentalsTestsName:
_________Number:
__________
FirstSection:
Readthefollowingstatementscarefully,pleasewrite"T"or"F"intheplaceoftheanwersheettoshowitistrueorfalse(10%):
1.Anapplicationisastaticsequenceofinstructionsthatmakesupanexecutablefile.Aprocessisusuallydefinedasaninstanceofarunningapplication.(T)
2.Accelerator、Bitmap、Menu、Toolbar、StatusbararealsostandardWin32GUIresourcetypes.(F)
3.MFCcompletelyencapsulatestheWindowsAPI,freeingthedeveloperfromallSDKdependence.(F)
4.Theapplicationframeworkimplementsthemessagemapdatastructure,whichprovidesthelinkbetweenthemessageIDandthefunctionthatwillhandlethemessage.(T)
5.Althoughthereleaseversionofaprojectismoreefficientthanit'sdebugversion,theyusethesamesetofDLLs.(F)
6.ThereismoreflexibilityinroutingacommandmessagethanaWindowsmessagesincecommandmessagescanbehandledbyawidevarietyofobjects.(T)
7.Pen,Brush,Font,RectangleareallGDIObjects.(F)
8.ThestatusbarcanbeeasilymanagedwiththestatusbareditorinDeveloperStudio.(F)
9.Mostoftheinitialworktocreateadialogboxisthesameformodalandmodelesstypes.Buttheuserneedtowriteadditionalcodeforamodelessdialogboxtoenablereciprocalcommunicationwithit’sapplication.(T)
10.CStringisadatatypesupportedbyMFC’sserializationoperators,thearchiveinsertion(<<),andextraction(>>)operators.(T)
SecondSection:
Inthissection,pleasechoosethecorrectanswerfromthefourstatementsineachofthefollowingquestions(36%):
1.Whichofthefollowingisarequiredfunctionforallwindows-basedapplications?
(A)
AWinMainBMyWndProcCWndMgrDGetMenu
2.CObjectisthebaseclassformostofMFC.Whichofthefollowingisnottheinformationandfoundationsthatprovides:
(C)
ARun-timeclassinformationBDiagnosticanddebuggingsupportCSomesimplevaluetypesDCompatibilitywithcollectionclasses
3.IfyouuseMFCtodevelopadocument/viewbasedproject,theDocument、View、FrameandApplicationclassusuallyarethedefaultfourelements,Whichoneofthefollowingisfalseabouttheirdeclarations:
(D)
ATheapplicationclassactsasabinderfortheframe,view,anddocumentobjectsandasetofGUIresourcesinaapplication.
BAdocumentisadataobjectwithwhichtheuserinteractsinaneditingsessionandaviewisawindowobjectthroughwhichtheuserinteractswiththedocument,CTheframeworkprovidesasetofstarterfilesforanapplicationandsuppliesstandarduser-interfacefeaturesthatyoucanimplementinyourapplication.
DSDIapplicationsallowonlyonedocumentframewindowatatime,butMDIapplicationshasawindowwithwhichtheusercanopenmultipleMDIchildwindowsandtheyshouldbethesametypes.
4.Whattooldoyounormallyusetoautomatesthecreationandeditingofclasses,andcreatesadditionalclassesbasedonMFC.(C)
AAppWizardBTheProjectWorkspaceCClassWizardDDeveloperStudioGallery
5.WhatisthepurposeoftheDECLARE_DYNCREATEmacro?
(A)
AToenableobjectsofCObject-derivedclassestobecreateddynamicallyatruntime.
BToenableobjectsofanyclasstobecreateddynamically
CTodynamicallycreatethedocuments
DTodynamicallycreatetheframesandviews.
6.InwhichcasewewillcallOnUpdatememberfunctionoftheCViewclass?
(B)
ACalledwhenaviewisfirstattachedtoadocument.
BCalledwhenthedocument'sdatahaschangedandtheviewneedstobeupdated.
CCalledwhentheapplication'sframehasbeenresized.
DCalledwhenyouwanttochangesomedocumentdata.
7.WhichoneofthefollowingstatementsisfalsewhenusingtheDeveloperStudiodebuggertosetandmanagebreakpoints?
(C)
ATosetabreakpointonasourcestatementextendingacrosstwoormorelines,youmustsetthebreakpointonthelastlineofthestatement.
BAnasterisk(*)intheBreakpointcheckboxindicatesthatthebreakpointisnotsupportedonthecurrentplatform.
CThebreakpointsyousetcannotbesavedaspartofyourprojects.
DYoucansetmorethanonelocationbreakpointonaline.
8.InaMFCapplication,whatisthemessagemapmacronameandhandlernameassociatedwiththeWM_MOUSEMOVEWindowsmessage?
AThemacroisWM_MOUSEMOVE_MESSAGEandthehandlerisOnMouseMoveMessage.
BThemacroisOnMouseMoveandthehandlerisON_MM_MOUSEMOVE.
CThemacroisON_WM_MOUSEMOVEandthehandlerisOnMouseMove.
DSincegeneralwindowmessagesarehandledbytheMFCframework,theyneverneedmessagemapentries.
9.Communicationbetweentheoperatingsystem,applications,andapplicationcomponentsisconductedthrough:
C
AWindowsmessages、Commandmessages
BWindowsmessages、Commandmessages、Event-notificationmessages.
CAlltypesofmessages.
DWindowsmessages、Commandmessages、System-registeredmessages.
10.WhichoneofthefollowingisnotaDC(DeviceContexts)doesinWindows:
BAGivespermissiontoanapplicationtouseanoutputdevice.BGivespermissiontoanapplicationtoredrawalloftheviews.CMaintainscurrentinformationabouthowtodraworpainttoawindow,suchasthecolors,brushorpenpatternsandsoon.DProvidesalinkbetweenaWindows-basedapplication,adevicedriver,andanoutputdevice,suchasamonitororprinter.
11.IfyouwanttodrawarectanglelikeG-1,whichoneofthefollowingcodescannotrealizeit,supposeyouhavethefollowingdefinition:
D
ApDC->Rectangle(0,0,100,100);
BpDC->MoveTo(0,0);pDC->LineTo(100,0);pDC->MoveTo(0,0);pDC->LineTo(0,100);pDC->MoveTo(100,100);pDC->LineTo(100,0);pDC->MoveTo(100,100);pDC->LineTo(0,100);
CCRectrect(0,0,100,100);pDC->Rectangle(&rect);
DpDC->Rectangle(CPoint(0,0),CPoint(100,100));
12Pleasereadthecodes,andselectthecorrectanswerabouttheoutputstring’scolorinsequence:
A
CPenpen1,pen2;
CPen*pOld;CPointpt(0,0);
pen1.CreatePen(PS_SOLID,1,RGB(255,0,0));
pen2.CreatePen(PS_SOLID,1,RGB(0,0,255));
pOld=pDC->SelectObject(&pen1);
pDC->TextOut(pt,”Thefirstline.”);
pDC->SelectObject(pOld);
pDC->TextOut(pt,”Thesecondeline.”);
pOld=pDC->SelectObject(&pen2);pDC->TextOut(pt,”ThethirdLine”);
ARED,BLACK,BLUEBBLACK,RED,BLACKCRED,BLUE,BLACKDRED,WHITE,BLUE
13Whenyouaredebuggingaprogram,youfindthatthereisadimmedmenuitem,whichoneofthefollowingmeasurescannotmakeitavailable:
D
Acheckifithasanassociatedcommandhandler.
Bcheckifyouhaveexecutedanoperationtomakeitunavailabletemporarily.
Ccheckifthereisnoobjectsthatcanbeused.
DcheckifithasacombinationwithanUpdatecommandhandler
14Whichoneofthefollowingisnottrueabouttoolbareditor:
C
AYoucannotdeletetheblankplaceholderbuttonontherightend.
BIntheToolbareditor,youcandragthebuttonoffthetoolbartodeleteabutton.
CIntheToolbareditor,youcandeleteabuttondirectlyandconvenientlybypressing“Delete”key.
DIfyouwanttocreateanewbutton,youcancopyabuttonandchangetheoriginalbitmaptothenewone.
15Inadialogboxclass,youwanttosavechangesofthedialogcontrolstoavariable,whatfunctionyouoftenaddintheprogram:
B
AInvalidate()BUpdateData()CUpdateData(false)DUpdate()
16WhichoneofthefollowingstatementsistrueabouttherelationshipofDDXandDDV?
D
ADDXandDDVoccurwhentheuserclicksOK.
BDDXandDDVaremutuallyexclusive;onlyonecanbeperformedforeachcontrol.
CThedevelopercannotextendDDXandDDV.
DInaDoDataExchangeroutine,ifaDDVroutineexists,itmustfollowimmediatelyafteritsassociatedDDXroutineinthedatamap.
17Templatesareusefulforgeneratingcollectionclassesbecause:
B
ATemplateshavebuilt-infunctionalityforcollections.
BTemplatesworkwitharbitrarydatatypes.
CAlltemplateshaveiterators,whichareusefulforcollectionclasses.
DTemplateshavebuilt-insupportforthemostcommondatatypes.
18Whichofthefollowingconditionsorstepsisnotrequiredtoaddsupportforserializationtoaclass?
D
ATheclassmustbepubliclyderivedfromCObjectoraclassderivedformCObject.
BTheclassdeclarationmustdeclarebothanoverriddenversionofCObject:
:
SerializeandinvocationoftheDECLARE_SERIALmacro.
CTheclassimplementationfilemustcontaintheimplementationforSerializeandaninvocationoftheIMPLEMENT_SERIALmacro.
DEachclassinanapplicationmusthavedifferent,sequentiallynumberedschema.
ThirdSection:
PleaseuseyourbriefwordsinEnglishtoexplainthefollowingphrases(14%):
1.Whatis"Event-drivenprogramming"?
2.PleaseexplainWhatis“Mappingmodes”andillustrateitwithsomedetailexamples.
2002Answer
MasteringMFCFundamentalsTests
Name:
_________ Number:
__________
Section A(26%):
Inthissection,pleasechoosethecorrectanswerfromthefourstatementsineachofthefollowingquestions:
(C)1. CObjectisthebaseclassformostof MFC.Whichoneofthefollowingisnottheinformationandfoundationsthatprovides:
A Run-timeclassinformation
B Diagnosticanddebuggingsupport
C Somesimplevaluetypes
D Compatibilitywithcollectionclasses
(D)2. IfyouuseMFCtodevelop a document/view basedproject,theDocument、View、FrameandApplicationclassusuallyarethedefaultfourelements,Whichoneofthefollowingstatementsisfalseabouttheirdeclarations:
A Theapplicationclassactsasabinderfortheframe,view,anddocumentobjectsandasetofGUIresourcesinaapplication.
B Adocumentisadataobjectwithwhichtheuserinter