COM 教程 计算机 英文.docx
《COM 教程 计算机 英文.docx》由会员分享,可在线阅读,更多相关《COM 教程 计算机 英文.docx(52页珍藏版)》请在优知文库上搜索。
1、IntroductionFormanypeople,learningCOMandDCOMistough.YouknowthatlearningCOMistherightthingtodo-youhearconstanthypeandyouknowthatmanyofMicrosoft,sproductsandprogrammertoolsarebasedonCOM,soitisobviouslysomethingthatisimportant.ButyoualsoknowthatCOMisreallyhard.YoumayhavealreadytriedtolearnCOMonce,ormay
2、beevenseveraltimes.Youmayhaveslidthroughacoupleofbooks,playedwithsomewizards,etc.Butitjustdoesn,tmakeanysense.Everythingseemsextremelycomplicatedandmuchharderthanitneedstobe.There,salsothevocabulary:marshalling,apartmentthreads”,z,singletonobjects“andsoon.Whatisthis?Thepurposeofthissetoftutorialsist
3、ohelpyoutoquicklyunderstandwhatisgoingonintheworldofDCOMsothatyoucancreateCOMclientsandserverseasily.Wedothatstartingatthebeginningandlayingthingsoutforyousimplyandintherightorder.BythetimeyoufinishthesetutorialsyouwillunderstandallofthebasicconceptsdrivingDCOMandyouwillbeabletoproceedquicklytolearn
4、therest.YouwillbeamazedathoweasyDCOMcanbeonceyougetagoodstart. TheBaSiCSOfCOM-thebestplacetostartisatthebeginning. SimDIeCoMCIientS-COMclientsareeasy SimPIeCOMSerVerS-usingtheAT1.wizardtobuildaserverTheBasicsofCOMUnderstandinghowCOMworkscanbeintimidatingatfirst.Onereasonforthisintimidationisthefactt
5、hatCOMusesitsownvocabulary.AsecondreasonisthatCOMcontainsanumberofnewconcepts.OneoftheeasiestwaystomasterthevocabularyandconceptsistocompareCOMobjectstonormalC+objectstoidentifythesimilaritiesanddifferences.YoucanalsomapunfamiliarconceptsfromCOMintothestandardC+modelthatyoualreadyunderstand.Thiswill
6、giveyouacomfortablestartingpoint,fromwhichwelllookatCOMsfundamentalconcepts.Oncewehavedonethis,theexamplepresentedinthefollowingsectionswillbeextremelyeasytounderstand.ClassesandObjectsImaginethatyouhavecreatedasimpleclassinC+calledxxx.Ithasseveralmemberfunctions,namedMethodA,MethodB,andMethodC.Each
7、memberfunctionacceptsparametersandreturnsaresult.Theclassdeclarationisshownhere:classxxxpublic:intMethodA(inta);intMethodB(floatb);floatMethodC(floatc);;Theclassdeclarationitselfdescribestheclass.Whenyouneedtousetheclass,youmustcreateaninstanceoftheobject.Instantiationsaretheactualobjects;classesare
8、justthedefinitions.Eachobjectiscreatedeitherasavariable(localorglobal)oritiscreateddynamicallyusingthenewstatement.Thenewstatementdynamicallycreatesthevariableontheheapandreturnsapointertoit.Whenyoucallmemberfunctions,youdosobydereferencingthepointer.Forexample:xxx*px;/px=newxxx;/p-MethodA(l);/delet
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- COM 教程 计算机 英文