Time of Update: 2018-12-07
{ For example :procedure TForm1.ComboBox1Change(Sender: TObject);begin SetActiveLanguage(ComboBox1.Text);end;procedure TForm1.FormCreate(Sender: TObject);begin ComboBox1.Items.AddStrings(SearchLanguagePack);end;}unit uLanguage;interfaceuses
Time of Update: 2018-12-07
把cxGridView裡OptionsView選項中的兩項修改成如下 OptionsView.Indicator = True OptionsView.IndicatorWidth = 40//寬度在customDrawIndicatorCell事件中填寫procedure TForm1.cxGrid1BandedTableView1CustomDrawIndicatorCell( Sender: TcxGridTableView; ACanvas: TcxCanvas;
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure
Time of Update: 2018-12-07
procedure CreateSumFooter(cxTableView: TcxGridDBTableView; const fieldList: string);var i: Integer; f: TcxGridDBTableSummaryItem; l: TStringList;begin l := TStringList.Create; l.DelimitedText := fieldList; l.Delimiter := ',';
Time of Update: 2018-12-07
type TLoginUser = record //登陸使用者結構 id: string; name: string; ruleid: string; rulename: string; pwd: string; end; PShareObjectRecord = ^TShareObjectRecord; TShareObjectRecord = record //共用對象結構 Connection: TADOConnection;
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure FormCreate(Sender: TObject); procedure
Time of Update: 2018-12-07
uses cxLookAndFeelPainters; type TMyCxGrid = class(TObject) class procedure DrawIndicatorCell( Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); end; { TMyCxGrid
Time of Update: 2018-12-07
Delphi中Socket的操作方式Delphi分別使用TClientSocket元件和TServerSocket元件來操縱用戶端 Socket和伺服器段Socket的連接和通訊。根據連接發起的方式以及本地 Socket要連接的目標,Socket之間的連接可以分為:用戶端連接、監聽連接以及伺服器端連接。(1)所謂用戶端連接,是指由用戶端的
Time of Update: 2018-12-07
一、有必要瞭解 INI 檔案的結構:;注釋 [小節名] 關鍵字=值...INI檔案允許有多個小節,每個小節又允許有多個關鍵字,“=”後面是該關鍵字的值。 值的類型有三種:字串、整型數值和布爾值。其中字串存貯在INI檔案中時沒有引號,布爾真值用1表示,布爾假值用0表示。注釋以分號“;”開頭。二、定義 1、在Interface的Uses節增加IniFiles;2、在Var變數定義部分增加一行:myinifile:Tinifile;
Time of Update: 2018-12-07
//資料集序列化function RecordsetToXML(const Recordset: _Recordset): string;var RS: Variant; Stream: TStringStream;begin Result := ''; if Recordset = nil then Exit; Stream := TStringStream.Create(''); try RS := Recordset; //
Time of Update: 2018-12-07
CnPack多語組件是CnPack組件包中的一個重要組成部分,主要用來用來實現多語言介面。它們雖未組成可安裝的獨立組件包,但它們功能相對獨立,在組件板上獨佔一頁,和其他組件關聯不大。 1、 最簡單的多語組件的使用步驟1. 建立一空工程,拖放一些可視化組件在上面。儲存。2. 拖一TCnHashLangFileStorage,添加一語言條目。3.
Time of Update: 2018-12-07
服務端與用戶端絕對是兩碼事。在用戶端我們提倡 Create/New 和 Free/Dispose,隨用隨申請,不用即釋放。但在服務端要盡量避免這樣做。在用戶端可以隨時使用 string 類型,但在服務端也必須盡量避免使用 string 。string使用起來異常方便,但我們看看編譯後的代碼恐怕就會只冒冷汗:原來編譯器為string的方便做了那麼多額外的工作。用戶端要為客戶解決記憶體,但服務端能“浪費”則“浪費”。 “玩伺服器就是玩記憶體”。
Time of Update: 2018-12-07
1.建立一個全域的HASH表initialization g_hash := THashedStringList.Create;finalization FreeAndNil(g_hash); 2.往全域HASH表裡面寫入 INI檔案的指定小節(字串定義集中放在一個小節裡面)讀取到的所有行,每次更選擇語言以後都要執行此操作。ini.ReadSectionValues('messages', g_hash);3.所有需要使用字串變數從這個全域HASH表中檢索function
Time of Update: 2018-12-07
//author: cxg{ For example :procedure TForm1.ComboBox1Change(Sender: TObject);begin SetActiveLanguage(ComboBox1.Text);end;procedure TForm1.FormCreate(Sender: TObject);begin ComboBox1.Items.AddStrings(SearchLanguagePack);end;}unit
Time of Update: 2018-12-07
自由FREE:記憶體頁既沒有提交也沒有被保留。它不能被進程訪問,但是可以供某個記憶體配置函數分配。 保留RESERVED:記憶體已經被調用進程保留,不能被其他進程或者線程使用。但是記憶體並沒有被使用,也沒有提交到實體儲存體器。 提交COMMITTED:記憶體已經被提交到實體儲存體器。記憶體標識為正在被使用。只有分配它的進程才可以使用該記憶體。
Time of Update: 2018-12-07
1.簡單介紹:cxGrid右下方的cxGrid1Level1是表示Grid表的層,cxGrid可以有多層,這相當於集合了PageControl的功能,而cxGrid1Level1右邊的cxGrid1DBTableView1相當於DBGrid一樣。右擊cxGrid1可以添加cxGrid1Level2,右擊cxGrid1Level2,可以選擇Create View , Add level 或者Delete Level。Add level可以增加子Level,Create
Time of Update: 2018-12-07
function UnicodeEncode(Str:string;CodePage:integer):WideString;var Len:integer;begin Len:=Length(Str)+1; SetLength(Result,Len); Len:=MultiByteToWideChar(CodePage,0,PChar(Str),-1,PWideChar(Result),Len); SetLength(Result,Len-1); //end is
Time of Update: 2018-12-07
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations }
Time of Update: 2018-12-07
http://www.ccw.com.cn/applic/prog/htm2003/20030423_096DZ.htmado控制項的參數轉化為Variant數組 使用ClientDataSet的DataRequest方法把Variant數組上傳 觸發伺服器DataSetProvider的OnDataRequest事件,在OnDataRequest對上傳的Variant數組進行解析 服務器上的ADO控制項根據上傳的參數操作數據庫 把操作的結果轉換為Variant數組,下發客戶端 客戶端解析Var
Time of Update: 2018-12-07
象使用虛擬記憶體一樣,使用記憶體映像檔案同樣需要經過保留和提交兩個過程,首先在進程記憶體空間保留一塊地區,然後提交實體儲存體給這段地區。不同的是實體儲存體來自於磁盤上的檔案,而不是系統的分頁檔案。也即將磁碟上指定的資料檔案作為虛擬記憶體,這個實現過程被稱為檔案映像,可以將檔案全部或部分映像到進程的地址空間中。檔案映像過以後,可以把檔案映像的部分當作已全部被載入記憶體一樣的去訪問它,這時又稱它為記憶體映像檔案。記憶體映像檔案使用步驟要使用記憶體映像檔案,可以按以下步驟:(1) 調用Windows