More Related Content Similar to Inside VCL (20) Inside VCL1. 陳寬達 ( 陳昇瑋 ) 中央研究院 資訊科學研究所 Inside V isual C omponent L ibrary 4. 獨立的 4GB 位址空間- Windows 95/98 架構 0xFFFFFFFF ~ 0xC0000000 1 GB 區域。用於 VxD 、記憶體管理、系統程式碼,所有 Win32 處理程序共享。 0xBFFFFFFF ~ 0x80000000 1 GB 區域。用於記憶體對映檔案及 Win32 DLL ,所有 Win32 程序共享。 0x7FFFFFFF ~ 0x00400000 2143289344 位元組,約 2044 MB ,每個 Win32 處理程序私有區域。 0x003FFFFF ~ 0x00001000 4190208 位元組,約 4 MB ,放置 DOS 及 Win16 應用程式。 0x00000FFF ~ 0x00000000 4096 位元組,用於偵測不合法指標。 5. 獨立的 4GB 位址空間- Windows NT 架構 2 GB 區域。用於作業系統、核心程式及驅動程式,應用程式無法存取。 0xFFFFFFFF ~ 0x80000000 0x7FFEFFFF ~ 0x00010000 2147352576 位元組,約 2047 MB ,每個 Win32 處理程序私有區域。 0x0000FFFF ~ 0x00000000 64 KB 區域。用於偵測不合法指標。 0x7FFFFFFF ~ 0x7FFF0000 64 KB 區域。用於偵測不合法指標。 19. 檢視 DLL 提供的函式 E:INNTystem32>dumpbin /exports user32.dll Microsoft (R) COFF Binary File Dumper Version 5.00.7022 Copyright (C) Microsoft Corp 1992-1997. All rights reserved. Dump of file user32.dll File Type: DLL Section contains the following Exports for USER32.dll 0 characteristics 336A2A2A time date stamp Sat May 03 01:53:46 1997 0.00 version 1 ordinal base 634 number of functions 634 number of names ordinal hint name 1 0 ActivateKeyboardLayout (00015B1A) 2 1 AdjustWindowRect (0000D704) 3 2 AdjustWindowRectEx (00007D8E) 4 3 AnyPopup (00043ABB) 5 4 AppendMenuA (00011F57) 6 5 AppendMenuW (0002D7A4) 24. 訊息處理機制 USER32.DLL 訊息迴圈 視窗函式 messages post messages send / post messages while ( GetMessage (&Msg, NULL, NULL, NULL)) { TranslateMessage (Msg); DispatchMessage (Msg); } switch (Msg.Message) { // 視窗建立時 case WM_CREATE: ... // 按下滑鼠左鍵 case WM_LBUTTONDOWN: ... // 按下按鍵時 case WM_KEYDOWN: ... // 關閉視窗時 case WM_CLOSE: ... } 28. 行程、執行緒、訊息佇列及 訊息迴圈 行程 執行緒 訊息佇列 程式碼 視窗 C 視窗函式 訊息迴圈 視窗 C 視窗 D 視窗 D 視窗函式 取出 分派 執行緒 訊息佇列 程式碼 視窗 A 視窗函式 訊息迴圈 視窗 A 視窗 B 視窗 B 視窗函式 取出 分派 工作執行緒 程式碼 41. VCL 的 Run-Time Package 面貌 109. Streaming Mechanism own write TWriter DFM file component TStream create WriteComponentRes function TStream.WriteComponent TStream.WriteComponentRes TStream.WriteDescent TStream.WriteDescentRes component component component component own component component component component Delphi RAD IDE / Programmer write 112. Additional Data in Stream object Form1: TForm1 ... object Timer1: TTimer Left = 264 Top = 176 end object Memo1: TMemo ... Lines.Strings = ( 'Memo1' 'Line 2' 'Line 3') end object StatusBar1: TStatusBar ... Panels = < item Width = 50 end item Bevel = pbRaised Width = 50 end item Width = 50 end> end end 118. Messaging USER32.DLL Message Loop (TApplication.ProcessMessage) TObjectInstance TObjectInstance TObjectInstance TObjectInstance TObjectInstance TObjectInstance WndProc Dispatch message method 1 message method 2 message method 3 ... DefaultHandler DefWindowProc window Forms.StdWndProc MainWndProc messages post messages send / post messages TWinControl ...