资源描述:
《developing.custom.delphi3.components.pdf》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、INTRODUCTIONAgoodtoolimprovesthewayyouwork.Agreattoolimprovesthewayyouthink.TheproofofDelphi’sgreatnesshasbeensneakinguponmeformostofthepasttwoyearsthatI’vebeenusingitheavily.Itwasn’tanysinglestupendousAha!I’mnotsureitwasevenacollectionofsmallerAha!s.Rather,itwasthegradualadoptionofanentir
2、elynewwayoflookingatprogramcode…whichIcanbestcharacterizeasnotlookingatprogramcodeatall.ArecentexampleshouldprovethatI’mnottryingtogetallZenonyouhere.OverthepastfewmonthsI’vebeenbuildingtoolsassociatedwithmyVirtualEncyclopediainitiative,inpartaspureresearch,butincreasinglytohelpmyself,myst
3、aff,andotherinterestedpeopleembedmetadata(thatis,content-descriptiveinformation)inHTMLdocumentspostedontheWeb.MyMETATaggerutil-ityiscentraltotheeffort:Itgathersdescriptivedataaboutadocumentfromtheuser,formatsthatdescriptivedatainsideHTMLMETAtags,andthenpushesthosetagsontotheWindowsclipboar
4、d.TheuserthenbringsuphisorherHTMLeditorfromthetaskbar,positionsthetextcursorintothedocumentheader,andpastestheMETAtagsintothedocumentheader.Havingarrangedvariousentrycontrolsontheutility’sform,IconsideredtheneedtogettextdatafromthecontrolsontotheWindowsclipboard.AtraditionalWindowshackerwo
5、uldinstinctivelyhavebegundiggingintoreferencemateriallookingforadescriptionoftheproperWindowsAPIcallsthathandledatatransfertotheclipboard.I’vethoughtmywaydownthatpathbefore,butthistimetheoptiondidn’tevenoccurtome.(Ihaveanaturalaversiontopointers,WindowsxixxxIntroductionhandles,thunks,conte
6、xts,andaboveallelsethatnever-to-be-sufficiently-cursedbrain-deadC-stylestringhandlingthatpervadesall“proper”APIprogramming.)IknewfromreadingandearlierexperiencethatDelphi’sTMemocomponenthadtheabilitytoforceitstextontotheclipboardwithaverysimplemethodcall.Granted,Ididn’tneedanothermemoonmyf
7、orm.Nosweat;it’sjustaboxthatdoesthings.Idroppedamemocomponentontheform,madeitinvisible,anduseditasaclipboard-enabledtexthopper.Iaccumulatedtextintheinvis-iblememo,andthenwhenalltheMETAtagswerereadytoroll,Icalledthemethodthatcrankedopenthehopperdooranddroppedth