外文翻译---数据库数据类型.doc
1DataTypesThistopicliststhedatatypesmostcommonlyusedintheMicrosoftFoundationClassLibrary.MostofthedatatypesareexactlythesameasthoseintheWindowsSoftwareDevelopmentKit(SDK),whileothersareuniquetoMFC.CommonlyusedWindowsSDKandMFCdatatypesareasfollows:BOOLABooleanvalue.BSTRA32-bitcharacterpointer.BYTEAn8-bitintegerthatisnotsigned.COLORREFA32-bitvalueusedasacolorvalue.DWORDA32-bitunsignedintegerortheaddressofasegmentanditsassociatedoffset.LONGA32-bitsignedinteger.LPARAMA32-bitvaluepassedasaparametertoawindowprocedureorcallbackfunction.LPCSTRA32-bitpointertoaconstantcharacterstring.LPSTRA32-bitpointertoacharacterstring.LPCTSTRA32-bitpointertoaconstantcharacterstringthatisportableforUnicodeandDBCS.LPTSTRA32-bitpointertoacharacterstringthatisportableforUnicodeandDBCS.LPVOIDA32-bitpointertoanunspecifiedtype.LRESULTA32-bitvaluereturnedfromawindowprocedureorcallbackfunction.UINTA16-bitunsignedintegeronWindowsversions3.0and3.1;a32-bitunsignedintegeronWin32.WNDPROCA32-bitpointertoawindowprocedure.WORDA16-bitunsignedinteger.WPARAMAvaluepassedasaparametertoawindowprocedureorcallbackfunction:16bitsonWindowsversions3.0and3.1;32bitsonWin32.DatatypesuniquetotheMicrosoftFoundationClassLibraryincludethefollowing:POSITIONAvalueusedtodenotethepositionofanelementinacollection;usedbyMFCcollectionclasses.LPCRECTA32-bitpointertoaconstant(nonmodifiable)RECTstructure.ClassWizard:Special-FormatCommentSectionsHome|Overview|HowDoI|TutorialThisarticleexplainswhereandhowClassWizardeditsyoursourcefiles.WhenyouaddanewclassusingClassWizard,special-formatcommentsareplacedinyourcodetomarkthesectionsoftheheaderandimplementationfilesthatClassWizardedits.ClassWizardnevermodifiescodethatisoutsidethesecommentedsections.ClassWizardcreatesthefollowingtypesofcommentsinyourcode:Message-MapCommentsVirtualFunctionCommentsDataMapComments2FieldMapCommentsActiveDispatchMapCommentsMessage-MapCommentsFormostclasses,therearetworelatedsectionsofcodethatClassWizardedits:themember-functiondefinitionsintheclassheaderfileandthemessage-mapentriesintheclassimplementationfile.TheClassWizardcommentsintheheaderfilelooklikethis:/AFX_MSG(<classname>)afx_msgvoidOnAppAbout();/AFX_MSGTheClassWizardsectionintheimplementationfileissetoffwithcommentsthatlooklikethis:/AFX_MSG_MAP(<classname>)ON_COMMAND(ID_APP_ABOUT,OnAppAbout)/AFX_MSG_MAPThenotesintheClassWizardsectionactasplaceholders.ClassWizardremovesthenotefromanyClassWizardsectioninwhichitwritescode.VirtualFunctionCommentsAswithmessagehandlers,ClassWizardwritescodetotwolocationswhenyouuseittooverrideavirtualfunctioninoneofyourclasses.TheClassWizardcommentsintheheaderfilelooklikethefollowingexampleforvirtualfunctionoverrides:/AFX_VIRTUAL(<classname>)virtualBOOLInitInstance();/AFX_VIRTUALTheClassWizardsectionintheimplementationfilehasnospecialcomments.Virtualfunctiondefinitionsinthe.cppfilelooklikeotherfunctiondefinitions.DataMapCommentsFordialogboxes,formviews,andrecordviews,ClassWizardcreatesandeditsthreeothersectionsthataremarkedwithspecialformatcomments:Membervariabledeclarationsintheclassheaderfile:/AFX_DATA/AFX_DATAMembervariableinitializationintheclassimplementationfile:/AFX_DATA_INIT./AFX_DATA_INITData-exchangemacrosintheimplementationfile:/AFX_DATA_MAP/AFX_DATA_MAPFieldMapComments3Forrecordfieldexchange,ClassWizardcreatesandeditsthreeothersectionsthataremarkedwithspecialformatcomments:Membervariabledeclarationsintheclassheaderfile:/AFX_FIELD/AFX_FIELDRecordexchangefunctioncallsintheimplementationfile:/AFX_FIELD_MAP/AFX_FIELD_MAPMembervariableinitializationsintheclassheaderfile:/AFX_FIELD_INIT/AFX_FIELD_INITActiveDispatchMapCommentsForActivemethoddispatch,ClassWizardcreatesandeditsfourothersectionsthataremarkedwithspecialformatcomments:Activeeventsintheclassheaderfile:/AFX_EVENT/AFX_EVENTActiveeventsintheclassimplementationfile:/AFX_EVENT_MAP/AFX_EVENT_MAPAutomationdeclarationsintheclassheaderfile:/AFX_DISP/AFX_DISPAutomationmappingintheclassimplementationfile:/AFX_DISP_MAP/AFX_DISP_MAPFormoreinformationseeWorkingwithDialogBoxData.AFX_MSG_MAPRemarksClassWizardandAppWizardinsertspeciallyformattedcommentdelimitersinyoursourcecodefilestomarktheplacesinyourfilesthatClassWizardcanwriteto.AFX_MSG_MAPisusedtomarkthebeginningandendofmessagemapentriesinaclasssmessagemap(inthe.CPPfile):/AFX_MSG_MAP(classname)/AFX_MSG_MAPFormoreinformation,seeAFX_MSG.ClassWizard:Special-FormatCommentSectionsHome|Overview|HowDoI|TutorialThisarticleexplainswhereandhowClassWizardeditsyoursourcefiles.WhenyouaddanewclassusingClassWizard,special-formatcommentsareplacedinyour4codetomarkthesectionsoftheheaderandimplementationfilesthatClassWizardedits.ClassWizardnevermodifiescodethatisoutsidethesecommentedsections.ClassWizardcreatesthefollowingtypesofcommentsinyourcode:Message-MapCommentsVirtualFunctionCommentsDataMapCommentsFieldMapCommentsActiveDispatchMapCommentsMessage-MapCommentsFormostclasses,therearetworelatedsectionsofcodethatClassWizardedits:themember-functiondefinitionsintheclassheaderfileandthemessage-mapentriesintheclassimplementationfile.TheClassWizardcommentsintheheaderfilelooklikethis:/AFX_MSG(<classname>)afx_msgvoidOnAppAbout();/AFX_MSGTheClassWizardsectionintheimplementationfileissetoffwithcommentsthatlooklikethis:/AFX_MSG_MAP(<classname>)ON_COMMAND(ID_APP_ABOUT,OnAppAbout)/AFX_MSG_MAPThenotesintheClassWizardsectionactasplaceholders.ClassWizardremovesthenotefromanyClassWizardsectioninwhichitwritescode.VirtualFunctionCommentsAswithmessagehandlers,ClassWizardwritescodetotwolocationswhenyouuseittooverrideavirtualfunctioninoneofyourclasses.TheClassWizardcommentsintheheaderfilelooklikethefollowingexampleforvirtualfunctionoverrides:/AFX_VIRTUAL(<classname>)virtualBOOLInitInstance();/AFX_VIRTUALTheClassWizardsectionintheimplementationfilehasnospecialcomments.Virtualfunctiondefinitionsinthe.cppfilelooklikeotherfunctiondefinitions.DataMapCommentsFordialogboxes,formviews,andrecordviews,ClassWizardcreatesandeditsthreeothersectionsthataremarkedwithspecialformatcomments:Membervariabledeclarationsintheclassheaderfile:/AFX_DATA/AFX_DATAMembervariableinitializationintheclassimplementationfile: