2018/12/24

Delphi in Depth. Windows Message vs Thread.

程式很忙


同事最近遇到程式運作流程不如預想的情形,來找我幫忙解決。

研究程式碼的過程中,發現他用到大量的 PostMessage / SendMessage,這是相當有趣的走向,同事解說是在於在 Event call Event 時,有時會因為 UI 刷新造成互相干擾進而發生例外,所以才這樣寫。

PostMessage 和 SendMessage 兩者差異說明如下:
Non Blocking 和 Blocking,也等同 Asynchronous (非同步) 和 Synchronous (同步) 的關係。

PostMessage 的場合:主程式 (Main Thread) 執行到此句時會把 Message 放進 Message Queue 裡 (可以視為 Sub Thread) 依序排好,等待 Main Thread Idle 時才會把 Message Queue 依序派送到主程式的對應函式處理。

程式流程如下:

2018/11/29

JavaScript for WebBroker framework



前端網頁寫久了,還是覺得 Delphi JavaScript DataSnap framework 在 AJAX 上使用來得方便,官方範例的 ReverseString 是這樣寫的:

2018/11/08

Bootstrap 4 學習雜記 (01)

設計心法:
以最小設備畫面進行設計,之後的放大會自適應。

單位:
只認 em / rem (相對單位),不建議使用 px。

骨架:
  • Column 以 12 為邊界,每個 Sub column 可再切分 12 Columns,以此類推。
  • 尺寸後贅 (小 -> 大):.col-* (xs-*) -sm-* -md-* -lg-* -xl-*。
  • 上述尺寸後贅大多可套用在像 Button 等物件類別宣告中,和 Grid 配置相呼應。


See also:

2018/07/26

Open dbExpress update - 2018.07.25 version


Update: 2018.07.25 support 10.2 Tokyo (Arc / Ent / Professional / Community Edition) -- Download Link


The major problem is finally solved.
In version 2017.01.17, the corrections are as follows:

  • Has been excluded from the installation of BPL, the IDE appears to lead to [Duplicates not allowed] error.
  • At the same time to solve the Run-time must be loaded dbxconnections.ini, dbxdrivers.ini problems.
  • Fixed DEMO program can not compile problem.


Details:

Download Open dbExpress 2017.01.17 supported RAD Studio 10.1 Berlin.

2018/07/25

Devart UniDAC Express 初體驗

Devart UniDAC Express 安裝
下載點:
https://www.devart.com/unidac/download.html


下載 10.2 Tokyo 的版本

安裝就一直按 Next,相當簡單

因為 UniDAC Express 不含任何的 Provider,所以這時的 TUniConnection 是連不上任何資料庫的。