Tải bản đầy đủ - 0 (trang)
.NET vs. the Java Platform

.NET vs. the Java Platform

Tải bản đầy đủ - 0trang

WhoThisBookIsFor

VisualC++.NET,withitssophisticatedapplicationframeworkand

supportfor.NET,isforprofessionalprogrammers,andsoisthisbook.I'll

assumethatyou'reproficientintheClanguage—youcanwriteanif

statementwithoutconsultingthemanual.AndI'llassumethatyou've

beenexposedtotheC++language—you'veatleasttakenacourseor

readabookevenifyouhaven'twrittenmuchcode.Youmightcompare

learningC++tolearningFrench.YoucanstudyFrenchinschool,butyou

won'tbeabletospeakfluentlyunlessyougotoaFrench-speaking

countryandstarttalkingtopeople.

TheVisualC++wizardssaveyoutimeandimproveaccuracy,but

programmersmustunderstandthecodethatthewizardsgenerateand,

ultimately,theymustunderstandthestructureoftheMFCandATL

libraries,theinnerworkingsoftheWindowsoperatingsystem,andhow

.NETworks.Iwon'tassume,however,thatyoualreadyknowWindows

and.NETprogramming.I'msurethatproficientCprogrammerscanlearn

WindowstheMFCwayandthe.NETway.It'smoreimportanttoknow

C++thanitistoknowtheWin32applicationprogramminginterface

(API).Youshould,however,knowhowtorunWindowsandWindowsbasedapplications.

Ifyou'realreadyexperiencedwiththeWin32APIorwiththeMFClibrary,

there'ssomethinginthisbookforyou,too.You'lllearnaboutnew

featuressuchastheMultipleTop-LevelInterface(MTI)andtheVisual

C++.NETwizards.Ifyouhaven'talreadyfiguredouttheComponent

ObjectModel(COM),thisbookpresentssomeimportanttheorythatwill

getyoustartedonunderstandingActiveXcontrols.You'llalsolearnabout

ATLServerandOLEDBtemplates.Andyou'lllearnaboutC++

programmingfortheInternet(includingDynamicHTML).Finally,this

bookincludeshard-to-findcoverageofthenewmanagedC++

extensions.



What'sNotCovered

It'simpossibletocovereveryaspectofWindowsand.NETprogramming

inasinglebook.I'veexcludedtopicsthatdependonspecial-purpose

hardwareandsoftware,suchasMAPI,TAPI,andcommunicationsport

access.I'llcoverusingActiveXcontrolsinanapplicationandwriting

ActiveXcontrolsusingATL,butI'lldeferthein-depthcoveragetoAdam

DenningandhisActiveXControlsInsideOut(MicrosoftPress,1997).I'll

getyoustartedwith32-bitmemorymanagement,DLLtheory,multithreadedprogrammingtechniques,and.NETprogramming,butyouneed

togetthethirdeditionofJeffreyRichter'sProgrammingApplicationsfor

MicrosoftWindows(MicrosoftPress,1997)ifyou'reseriousaboutthese

subjects.AnotherusefulbookisMFCInternalsbyGeorgeShepherdand

ScotWingo(Addison-Wesley,1996).I'llalsogiveyouaheadstartinto

the.NETspace,butI'llleavethehardcoreruntimeissuestoJeffrey

Richter'sApplied.NETProgramming(MicrosoftPress,2002).



HowtoUseThisBook

Whenyou'restartingwithVisualC++.NET,youcanusethisbookasa

tutorialbygoingthroughitsequentially.Later,youcanuseitasa

referencebylookinguptopicsinthetableofcontentsorintheindex.

Becauseofthetightinterrelationshipsamongmanyapplication

frameworkelements,itwasn'tpossibletocleanlyisolateeachconceptin

itsownchapter,sothebookisn'torganizedasanencyclopedia.When

youusethisbook,you'lldefinitelywanttokeeptheonlinehelpavailable

forlookingupclassesandmemberfunctions.

Ifyou'reexperiencedwithearlierversionsofVisualC++,scanPartIfor

anoverviewofnewfeatures.ThenskipthebasicMFCcoverageinPartII

butreadthemoreadvancedcoverage.Also,besuretoreadthe.NET

coverage.Muchofthesoftwaredevelopmentcommunity'seffortsare

headinginthisdirection,andVisualC++.NETfullysupportsthe.NET

programmingmodel.



HowThisBookIsOrganized

Asthetableofcontentsshows,thisbookhassixpartsandanappendix

section.



PartI:Windows,VisualC++.NET,andApplication

FrameworkFundamentals

Thisparttriestostrikeabalancebetweenabstracttheoryandpractical

application.AfteraquickreviewofWin32andtheVisualC++.NET

components,you'llbeintroducedtotheMFCapplicationframeworkand

thedocument-viewarchitecture.You'lllookatasimple"Hello,world!"

programbuiltwiththeMFClibraryclassesthatrequiresonly30linesof

code.



PartII:MFCEssentials

TheMFClibrarydocumentationpresentsalltheapplicationframework

elementsinquicksuccession,withtheassumptionthatyou'reatleast

familiarwiththeoriginalWindowsAPI.InPartIIofthisbook,you're

confinedtoonemajorapplicationframeworkcomponent—theview,

whichisreallyawindow.You'lllearnwhatexperiencedWindows

programmersknowalready,butinthecontextofC++andtheMFC

libraryclasses.You'llusetheVisualC++.NETtoolsthateliminatemuch

ofthecodingdrudgerythatearlyWindowsprogrammershadtoendure.

Thispartcoversalotofterritory,includinggraphicsprogrammingwith

bitmaps,dialogdataexchange,ActiveXcontrolusage,32-bitmemory

management,andmulti-threadedprogramming.Theexerciseswillhelp

youtowritereasonablysophisticatedWindows-basedprograms,but

thoseprogramswon'ttakeadvantageoftheadvancedapplication

frameworkfeatures.



PartIII:MFC'sDocument-ViewArchitecture

Thispartintroducestherealcoreofapplicationframeworkprogramming

—thedocument-viewarchitecture.You'lllearnwhatadocumentis



(somethingmuchmoregeneralthanawordprocessingdocument),and

you'llseehowtoconnectthedocumenttotheviewthatyoustudiedin

PartII.You'llbeamazed,onceyou'vewrittenadocumentclass,athow

theMFClibrarysimplifiesfileI/Oandprinting.

Alongtheway,you'lllearnaboutcommandmessageprocessing,toolbars

andstatusbars,splitterframes,andcontext-sensitivehelp.You'llalsobe

introducedtotheSingleDocumentInterface(SDI),theMultiple

DocumentInterface(MDI),andtheMultipleTop-LevelInterface(MTI),

whichisthecurrentstandardforWindows-basedapplicationssuchas

MicrosoftWord.

PartIIIalsodiscussesdynamiclinklibraries(DLLs)writtenwiththeMFC

library.You'lllearnthedistinctionbetweenanextensionDLLanda

regularDLL.



PartIV:COM,Automation,ActiveX,andOLE

COMitselfdeservesmorethanonebook.PartIVwillgetyoustartedin

learningfundamentalCOMtheoryfromtheMFCpointofview.You'll

progresstoAutomation,whichisthelinkbetweenC++andVisualBasic

forApplications(VBA).You'llalsobecomefamiliarwithuniformdata

transfer,andyou'lllearnthebasicsofcompounddocumentsand

embeddedobjects.You'lllearnabouttheATLclasslibrarysupportfor

OLEDB.



PartV:ProgrammingfortheInternet

ThispartstartswithatechnicalInternettutorialthatcoverstheTCP/IP

protocolandthefundamentalsofInternetprogramming.You'lllearnhow

todevelopserversusingATLServer,andyou'lllearnhowtoprogramfor

DynamicHTML.



PartVI:.NETandBeyond

TheInternetisevolvingasthenextfrontierforsoftwaredevelopment.

TheInternetisnolongerjustaboutbuildingWebsitesforpeopleto

simplylookat—it'saboutWebsitesthatpeoplecanprogram.Thewire's



inplace,butuntiltheadventofXML,noonewasbeenabletoagreeon

howtosendmethodcallsacrosstheInternet.Twomainthrustsof.NET

includeWebservicesandserver-baseduserinterfaces..NETfully

supportsboththesenotions,alongwithanewwaytowriteclientuser

interfaces:WindowsForms.PartVIcoverswhat.NETisallaboutand

whatyoucandowithitasaplatform.Includedherearechaptersonthe

commonlanguageruntimeandmanagedcode,programmingmanaged

componentsusingC++,ASP.NET,andADO.NET.



Appendixes

AppendixAcontainsalistofmessagemapmacrosandtheir

correspondinghandlerfunctionprototypes.Thecodewizardsavailable

fromClassViewusuallygeneratethiscodeforyou,butsometimesyou

mustmakemanualentries.

AppendixBoffersadescriptionoftheMFCapplicationframework's

runtimeclassinformationanddynamiccreationsystem.Thisis

independentoftheruntimetypeinformation(RTTI)featurethatisnowa

partofANSIC++.



Win32vs.Win16

AfewoldcomputersouttherearestillrunningWindows3.1.However,

there'snotmuchpointinspendingmoneywritingnewprogramsfor

obsoletetechnology.ThiseditionofProgrammingwithMicrosoftVisual

C++.NETisabout32-bitprogrammingforWindows98/MeandWindows

NT/2000/XPusingtheWin32API.Ifyoureallyneedtodo16-bit

programming,Isuggestthatyoufindanoldcopyofthesecondeditionof

thisbook.



SystemRequirements

Tousethisbook,you'llneedtohaveVisualC++.NETorVisualStudio

.NETinstalledonyourcomputer.Anycomputerthatsatisfiesthe

minimumrequirementsforVisualC++.NETwillworkeffectivelywith

mostoftheexamplesinthisbook.BeawarethatWindowsXPHome

EditionandWindowsNT4.0don'tsupportthehostingofASP.NETWeb

applicationswiththe.NETFramework.Youcanbuildtheseprojectson

theseoperatingsystems,butyou'llneedtouploadtheprojectstoa

properlyconfiguredhosttoexecutethem.



SampleFiles

Youcanfindthesamplefilesonthebook'scompanionCD,alongwith

othersupplementalcontent.ToaccessthefilesontheCD,insertthedisc

inyourcomputer'sCDdriveandmakeaselectionfromthemenuthat

appears.IftheAutoRunfeatureisnotenabledonyoursystem(ifamenu

doesn'tappearwhenyouinserttheCDintothedrive),runStartCD.exein

therootfolderofthecompanionCD.Installingthesamplefilesonyour

harddiskrequiresapproximately60MBofdiskspace.Ifyouhavetrouble

runninganyofthesefiles,refertothetextinthebookthatdescribes

theseprograms.

WithaconventionalC-languageprogramusingtheWindowsAPI,the

sourcecodefilestellthewholestory.WiththeMFClibraryapplication

framework,thingsarenotsosimple.TheMFCApplicationWizard

generatesmuchoftheC++code,andtheresourcesoriginateinthe

resourceeditors.Theexamplesintheearlychaptersofthisbookinclude

step-by-stepinstructionsforusingthetoolstogenerateandcustomize

thesourcecodefiles.You'dbewelladvisedtowalkthroughthose

instructionsforthefirstfewexamples—there'sverylittlecodetotype.For

themiddlechapters,usethecodefromthesamplefilesbutreadthrough

thestepstoappreciatetheroleoftheresourceeditorsandthewizards.

Forthefinalchapters,notallthesourcecodeislisted.You'llneedto

examinethesamplefilesforthoseexamples.

Asidefromthesamplefiles,thebook'ssupplementalcontentincludes

twoeBookinstallations:astandaloneeBookinstallationandaVisual

StudioHelpeBookinstallation.ThestandaloneeBookinstallationallows

youtoaccessanelectronicversionoftheprintbookdirectlyfromyour

desktop.TheVisualStudioHelpeBookinstallationallowsyoutoaccess

thesecondelectronicversionoftheprintbookdirectlyfromtheVisual

Studio.NEThelpsystem.



VisualStudio.NETProfessionalTrialVersion

InadditiontothecompanionCD,thisbookalsoincludesaDVDwithan

evaluationcopyofVisualStudio.NETProfessional.Thisevaluationcopy

canhelpyoufollowtheexamplesinthisbookandgetyoustarted

learningVisualC++.NET,butthesoftwarewillexpireandstopworking

60daysafteryouinstallit.Youcanlearnmoreaboutthisevaluationcopy

anditssystemrequirementsat

http://msdn.microsoft.com/vstudio/productinfo/trial.asp.Notethatno

productsupportisavailableforthetrialversion.



WindowsFormsLibraryExtensions

OneofthebiggestsellingpointsbehindMFCduringthe1990swasthe

greatclasslibrariesavailableforextendingtheframework.WithWindows

Formsonthehorizon,it'stimetokeepaneyeoutforclasslibrariesthat

extendWindowsForms.

MFCanditsextensionswereconfinedtotheC++language,butthe.NET

commonlanguageruntimeoffersavarietyofsyntaxesforwriting

WindowsForms,includingC#,VisualBasic.NET,andManagedC++.

Syncfusion,acompanybasedinCary,NorthCarolina,providesawide

varietyof.NETtoolstomakeprogrammingfor.NETeasier.Syncfusion's

EssentialSuiteincludescomponentstomakeyour.NETWindowsForms

applicationsmoresolidandpolished.Youcandownloadafullyfunctional

15-daytrialversionfromhttp://www.syncfusion.com,aswellasthe

EssentialSuiteInteractiveShowcase,anapplicationthatshowsseveral

Syncfusioncomponentsinaction.Thecomponentsrununderthe

commonlanguageruntime,sotheyworkwithManagedC++aswellas

withC#andVisualBasic.NET.



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

.NET vs. the Java Platform

Tải bản đầy đủ ngay(0 tr)

×
x