




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
1、MFC Programming and C + + related technologiesMFC, Microsoft Foundation Classes (Microsoft Foundation Classes), is actually provided by Microsoft for the C + + environment forwriting applications in a framework and engine, VC+ + is to Windows, developers use professional C + + SDK (SDK, Standard Sof
2、tWare Develop Kit, professional software development platform), MFC isit a supporting software development kit, MFC, as with the VC + + flesh and blood portion (Note C + + and VC + + differences: C + + is a programming language, is a we acknowledge the preparation of the general specification of sof
3、tware, and VC + + is a compiler,or a compiler + source code editor IDE, WS, PlatForm, which Pascal and Delphis relationship with a truth, Pascal was the language ofDelphi basic, Delphi Pascal specification for use under Winapplication development and compilation, but VB is different fromthe relation
4、ship between language and Basic, Basic language isdevelopedin VBapplicationslanguage withBC+ + VCLis a non-plugtype as package,classlibrary,but MicrosoftMFCclassisdesignedfor the distribution of VC + + . Win API and MFC is a combinationof C + +,API, thatMicrosoftsWindows, the applicationprogrammingl
5、anguage interface, is a software programming specifications, butis not a programming language itself, can allow users to use avarietyofthirdparties(such as the I side,Microsoftisa party,Borlandisthe third party to)programming language forapplicationson Windows, the development of these applications
6、were developed to run in Windows, such as VB, VC + +, Java , Delhpi essentiallyallof theprogramming language functionfrom theAPI, so using themto developapplicationsthatcan work outthe message intheWindowssystem and graphics, the compliance with Windows as an operatingsystemsinternalimplementation,i
7、tis alsoa necessity,MicrosoftIf you do not provide API, this world of Windows programming jobwould notexist,Microsoftsproductwillquicklybecome a garbagefrom the fashion, the above mentioned API function, MFC is aMicrosoft proprietary C + + package, which allows users to combinethe one development ea
8、sier, because MFC is the API package,Microsoftdevelopers in Windows, using C + + & MFC preparationsoftware for a large number of the section, such as theimplementation of the message processing applications, equipment,environmental graphics, this combination is convenient for thepurpose, we must pay
9、 the price (which is Microsofts style ), andtherefore created a MFC class in the package of a certain degreeof redundancy and circuitous, but this is acceptable .Finally, understand that MFC is not just a function of simpleinterface development system, which provides most of the classesused to inter
10、face development, associated with a window of theaction,but itprovidesa lotofclassin theclassis notassociatedwitha window thatthe categoriesThe roleisnotan interfaceclassdoes not implement the control of a window object (such as thecreation,destruction),but somein Windows(usingMFCvast majorityof pro
11、grams written to run in Windows) to implement the internalprocessingoftheclass,such as database managementetc.,the studyshould be most time consuming is the message and the deviceenvironment, C + + and MFC to learn the most difficult part is thepointer, C + + object-oriented programming in other par
12、ts, such asdata types, flow control both is not difficult, it is recommendedto learn C + + version of the data structure. MFC encapsulatesMicrosofts API. What does that mean? As a provider of powerfulwindows application programming interfaceto the operatingsystem,programmers do a lot of convenience,
13、 the traditional win32development (direct interface functions with windows API) forprogrammers is very difficultbecause, API functionstoomore, andthe name of the mess, from zero to a window frame is easilyofApplication framework, classifiedin thetraditionalAPI package,and created a program for you g
14、eneral framework MFC is Windows API package, which greatly simplifies our work; learn VC is mainly to learn MFC, there are about 100 classes, but also commonly used intwenty or thirty. Back four words should be the same as those commonly used in class get to know; of course, do not memorize, to exer
15、cises to learn them; Moreover, not every class all thefunctions within, to accumulate. If you really want to be a master, to be a laptop think it is important to their classes, functions,down, ready to learn, but also a good spot method. Programming Advantages With the innovation of programming lang
16、uages, MFC shortcomings become increasingly prominent. The most important entry barrier is of Windows API or driver is in your own code touse API functions directly, while the API and driver information are based on C language-based, which makes VC programmersto more easily use WindowsAPI. This, tha
17、t is,when the VC startedto pay more to the programmer to learn, but once mastered, thedevelopment of other areas of the program or using third-partysoftware,such as industrialcontrolprocedures,theunderlyingTheprograms are written in C language, but rather VC programmers canquicklygrasp the fieldof p
18、rogramming.And many otherprogramminglanguages can not even find relevant information. This shows thatVC (MFC) is actuallyan entrydifficult,butveryeasy tolearnthelanguage extension framework. If only limited to one area, then VCis no advantage atall,butifyou develop a new fieldofapplicationor the pro
19、gram involvesa number ofapplicationareas,itcan reducethe frequency of repetitionand difficulty,VC (MFC) of thebenefitswill immediately apparent. Language development C + + languagedevelopment can be dividedintothreestages:The firststage,from80 to 1995. This phase isbasicallyC + + language is thetrad
20、itionaltype of object-oriented language, and by virtue of the efficiencyof close to C language, developed for use in the industrial sectoraccounts for a significant language share; The second phase from1995 to2000, thisstageas theStandardTemplateLibrary(STL)andlater the Boost libraries such as the e
21、mergence of genericprogramming in C + +, the proportionof occupied more and more sexual.Of course, the sameas Java,C # and otherlanguages and the emergenceof large-scale some impact; The third stage, from 2000 to date,due to Loki, MPL and other libraries as the representative of generative programmi
22、ng and template meta programming there, C + + appeared in the , so that C + + programming language of the most complex one C + + Getting Started C + + is a language, merely its syntax, features, standard library already is a very advanced courses, so the time to start learning, we must first lay a s
23、olid foundation. There are a lot of the Visual C + + book, although itmay take 1-2 chapters to introduce the basic characteristics of C+ +, but that will not let you get started. Therefore, beginners should choose to learn C + + for C + + language itself, books, and can not be for the Visual C + +,
24、MFC or Windows APIs. Learning C+ + should be easy todifficult,step by step. Often said thatbeforelearning C + + should learn C language before. In fact it is notnecessary, C + + and C language, while a relationship, it is stilltwo different languages. Of course, before learning C + +programming lang
25、uage to learn than others is very good. C + + thatmake learningfaster,afterall,a lot of computer language conceptsare interlinked. As for the zero-based beginners, you should stopand do not become impatient. To become a master of C + + is not soeasy to takegreatefforts.From the introductorytextbook
26、ofchoice,mainly to see the learners own situation. If you andHemopurification the C + + programming. Note that 2004 edition,2006 edition of the book is a castrated version, up to theobject-oriented.AlthoughC and C + + are similar,butsaidbefore,C and C + + shouldbe used tolearntwo languages,so thatth
27、e contentsof 06 to a littlebit lacking.Transplantationand Hemopurification04 edition of this book is more structured, and organized is alsovery clear. If the basis of other the estimatedandHemopurification teachers book textbooks, are more subject torecognized. If you start from the zero-based learn
28、ing C + +, it isrecommended to use Pan Jiajie of learn C+ +.This book is a bookin 2008, I . This book is mainly forbeginners, put itis also moreinteresting tocompare thosewho can interestinlearning. So thereis no basis for the beginner This book is also a good choice, justwant to quickly become the
29、master, may be reading this book is notenough. As forthe book afterreadingthe entry,you should see some.If you are interested in other languages, but also to look at C # and Java, C + + they are a lot of concepts from grammar and are similar.The design principles of C + + ? C + + designed as a stati
30、c type,and C as efficient and portable multi-purpose programming language. ? C + + designed to support direct and wide variety of programming styles (procedural programming, data abstraction, object-orientedprogramming, generic programming). ? C + + is designed to giveprogrammers more choice, even i
31、f the wrong choice could lead toprogram designers. ? C + + designed to be compatible as possiblewith C, whereby a C to C + + from the smooth transition. ? C + + to avoid limited or no general- purpose platform features. ? C + +does not use the features will bring additional costs. ? C + + is designe
32、d without complex programming environment.MFC 程序設(shè)計與 C+相關(guān)技術(shù)MFC,微軟基礎(chǔ)類 (Microsoft Found第48頁ndation Classes), 實際上是微軟提供的 , 用于 在 C+環(huán)境下編寫應(yīng)用程序的一個框架和引擎 ,VC+是 Windows 下開發(fā)人員使用的專 業(yè) C+ SDK(SDK,Standard SoftWare Develop Kit, 專業(yè)軟件開發(fā)平臺 ),MFC 就是掛 在它之上的一個輔助軟件開發(fā)包 ,MFC 作為與 VC+血肉相連的部分(注意C+和VC+的區(qū)別:C+是一種程序設(shè)計語言,是一種大家都承認(rèn)的軟件
33、編制的通用規(guī)范,而VC+只是一個編譯器 , 或者說是一種編譯器 +源程序編輯器的 IDE,WS,PlatForm, 這跟 Pascal 和 Delphi 的關(guān)系一個道理 ,Pascal 是 Delphi 的語言基礎(chǔ) ,Delphi 使用 Pascal 規(guī)范來進行 Win 下應(yīng)用程序的開發(fā)和編譯 , 卻不同于 Basic 語言和 VB 的關(guān) 系,Basic 語言在 VB 開發(fā)出來被應(yīng)用的年代已經(jīng)成了 Basic 語言的新規(guī)范 ,VB 新加 的 Basic 語言要素 , 如面向?qū)ο蟪绦蛟O(shè)計的要素 , 是一種性質(zhì)上的飛躍 , 使 VB 既是一 個 IDE, 又成長成一個新的程序設(shè)計語言 ),MFC
34、同 BC+集成的 VCL 一樣是一個非外掛 式的軟件包 , 類庫 , 只不過 MFC 類是微軟為 VC+專配的 . MFC 是Win API 與 C+的結(jié)合 ,API, 即微軟提供的 Windows 下應(yīng)用程序的編程語言接口 , 是一種軟件編程的規(guī)范 , 但不是一種程序開發(fā)語言本身 , 可以允許用戶使用 各種各樣的第三方 ( 如我是一方 , 微軟是一方 ,Borland 就是第三方 ) 的編程語言來進 行對 Windows 下應(yīng)用程序的開發(fā) , 使這些被開發(fā)出來的應(yīng)用程序能在 Windows 下運 行, 比如 VB,VC+,Java,Delhpi 編程語言函數(shù)本質(zhì)上全部源于API, 因此用它們
35、開發(fā)出來的應(yīng)用程序都能工作在 Windows 的消息機制和繪圖里 , 遵守 Windows 作為一個 操 作系統(tǒng)的內(nèi)部實現(xiàn), 這其實也是一種必要, 微軟如果不 提 供 API, 這 個 世 上 對 Windows 編程的工作就不會存在 , 微軟的產(chǎn)品就會迅速從時尚變成垃圾 , 上面說到 MFC 是微軟對 API 函數(shù)的專用 C+封裝 , 這種結(jié)合一方面讓用戶使用微軟的專業(yè) C+ SDK 來進行Windows 下應(yīng)用程序的開發(fā)變得容易 , 因為 MFC 是對 API 的封裝 , 微軟做 了大量的工作 , 隱藏了好多程序開發(fā)人員在 Windows 下用 C+ & MFC 編制軟件時的 大量內(nèi)節(jié) ,
36、 如應(yīng)用程序?qū)崿F(xiàn)消息的處理 , 設(shè)備環(huán)境繪圖 , 這種結(jié)合是以方便為目的的 , 必定要付出一定代價 ( 這是微軟的一向作風(fēng) ), 因此就造成了 MFC 對類封裝中的一定 程度的的冗余和迂回 , 但這是可以接受的 . 最后要明白 MFC 不只是一個功能單純的界面開發(fā)系統(tǒng) , 它提供的類絕大部分用來 進行界面開發(fā) , 關(guān)聯(lián)一個窗口的動作 , 但它提供的類中有好多類不與一個窗口關(guān)聯(lián) , 即類的作用不是一個界面類 , 不實現(xiàn)對一個窗口對象的控制 ( 如創(chuàng)建 , 銷毀 ), 而是一 些在 Windows( 用 MFC 編寫的程序絕大部分都在 Windows 中運行 ) 中實現(xiàn)內(nèi)部處理的 類, 如數(shù)據(jù)庫的
37、管理類等 , 學(xué)習(xí)中最應(yīng)花費時間的是消息和設(shè)備環(huán)境 , 對 C+和 MFC 的 學(xué)習(xí)中最難的部分是指針 ,C+面向?qū)ο蟪绦蛟O(shè)計的其它部分 , 如數(shù)據(jù)類型 , 流程控 制都不難 , 建議學(xué)習(xí)數(shù)據(jù)結(jié)構(gòu) C+版。MFC 是微軟封裝了的 API 。什么意思呢? windows 作為一個提供功能強大的應(yīng)用 程序接口編程的操作系統(tǒng), 的確方便了許多程序員, 傳統(tǒng)的 win32 開發(fā)(直接使用 windows 的接口函數(shù) API ) 對于程序員來說非常的困難,因為, API 函數(shù)實在太多了, 而且名稱很亂,從零構(gòu)架一個窗口動輒就是上百行的代碼。 MFC 是面向?qū)ο蟪绦蛟O(shè) 計與 Application fra
38、mework的完美結(jié)合,他將傳統(tǒng)的 API 進行了分類封裝,并且 為你創(chuàng)建了程序的一般框架, MFC 是對 WindowsAPI 的封裝, 大大簡化了我們的工作; VC主要就是要學(xué) MFC, 學(xué) 大約有 100 多個類,但常用的也就二三十個。應(yīng)該象背 4 級單詞一樣將這些常用類 搞懂;當(dāng)然不要死記,要通過看幫助、看例子、動手練習(xí)來學(xué)會它們; 而且,并非 每個類的內(nèi)部的所有函數(shù)都要學(xué)會,要日積月累。 如果真的想成為高手, 做個筆記 本把自己認(rèn)為重要的類、函數(shù)記下來,隨時學(xué)習(xí),也是很好的突擊方法。 編程優(yōu)勢 隨著編程語言的推陳出新, MFC 一些缺點日益突出。最重要的就是入門門檻相對 其他語言要高
39、, 而且同樣完成一個任務(wù)代碼量相對較多。 而原有的優(yōu)勢如運行速度 快等,也因為其他編程語言的日臻完善和個人電腦的運算速度增加而顯得不那么突 出。 MFC 似乎江河日下。但是 MFC 真的沒有任何優(yōu)勢了嗎?不是,面對底層程序, 它能很輕松的與 Windows API 或驅(qū)動程序結(jié)合,就是在自己的代碼中直接使用 API 函數(shù),而 API 和驅(qū)動程序的資料都是以 C 語言為基礎(chǔ)的,這使得 VC 程序員能夠更 輕松的使用WindowsAPI。這樣造成了一個很有意思的現(xiàn)象, 即入門時 VC 程序員要 付出更多的努力來學(xué)習(xí),但是一旦掌握后,開發(fā)其他領(lǐng)域的程序或使用第三方軟件 時,如工業(yè)控制類的程序,由于底
40、層的程序都是用 C 語言編寫,反倒是 VC 程序員 能夠更快的掌握該領(lǐng)域的編程技術(shù)。而很多其他的編程語言甚至找不到相關(guān)的資 料。這就說明 VC(MFC)實際上是一種入門困難,但是擴展學(xué)習(xí)卻很輕松的語言框 架。如果既限于某一領(lǐng)域的話 VC 毫無優(yōu)勢可言,但是如果開發(fā)一個新的領(lǐng)域的應(yīng) 用程序或者該程序涉及多個應(yīng)用領(lǐng)域的話, 可減少重復(fù)學(xué)習(xí)的頻率和難度, (MFC) VC 的優(yōu)勢會立刻顯現(xiàn)出來。語言發(fā)展 C+語言發(fā)展大概可以分為三個階段: 第一階段第68頁從 80 年代到 1995 年。這一階段 C+語言基本上是傳統(tǒng)類型上的面向?qū)ο笳Z言,并且憑借著接近 C 語言的效率,在工業(yè)界使用的開發(fā)語言中占據(jù)了相 當(dāng)大份額; 第二階段從 1995 年到 2000 年, 這一階段由于標(biāo)準(zhǔn)模板庫 (STL) 和后來的 Boost等程序庫的出現(xiàn),泛型程序設(shè)計在C+中占據(jù)了越來越多的比重性
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 三年級數(shù)學(xué)故事解讀
- 小王子書中純真之愛讀后感
- 自然資源開發(fā)與保護合作協(xié)議
- 智能家電銷售與保修協(xié)議
- 初中生歷史故事解讀
- 運輸合同運輸補充協(xié)議
- 辦公區(qū)域布局調(diào)研報告
- 環(huán)保咨詢服務(wù)協(xié)議
- 電子設(shè)備銷售及安裝維護合同
- 物流行業(yè)運輸損壞物品賠償協(xié)議
- 北京電子科技職業(yè)學(xué)院招聘考試題庫2024
- 貸款的培訓(xùn)課件
- 無人系統(tǒng)自主控制
- 化工原理陳敏恒課件
- 景區(qū)保安投標(biāo)方案(技術(shù)方案)
- 中建辦公、生活區(qū)臨時設(shè)施施工方案
- 中國金融書法家協(xié)會入會申請表
- 地下室頂板支撐回頂方案
- 痛經(jīng)教學(xué)講解課件
- 基于康耐視相機的視覺識別實驗指導(dǎo)書
- 水務(wù)集團有限公司人事管理制度
評論
0/150
提交評論