Feb 12

I, in Delphi XE8, have experienced it twice when switching (F12) to the Form/Unit interface,Delphi crashed directly,Windows recorded the following two entries:

Source: Application Error
Failed application name: bds.exe
Failed module name: Castalia220.bpl

Source: Windows Error Reporting
事件名稱: APPCRASH
問題簽章:
P1: bds.exe
P4: Castalia220.bpl

繼續瀏覽 »

Nov 12

  今天想測試 Delphi 連結 AD 的功能,網路上教學說,可以透過「Component → Import Compont…」來匯入,但實際操作時,卻出現 “存取 OLE 登錄時發生錯誤。” 的錯誤訊息。

繼續瀏覽 »

Feb 19

When using Quick Report 1920*1080 with resolution plus 125% and higher display settings,the 'Preview Print' scale may be incorrect(either too large or too small),but the actual printout is normal,To fix this,you need to modify the qrprntr.pas file of Quick Report in the development environment,There are two ways to fix this。

繼續瀏覽 »

Jul 11
unit unit1;

interface

uses
  Windows, Messages....

type
  TFormName = (Casefm1, Casefm2, Casefm3);

function xxx(): Boolean;
var
  StrFormName: String;
  CaseFormName: TFormName;
begin
  StrFormName := 'Case' + vFormName; 
  // 將 FormName(物件) 與 TFormName(值) 做區隔。
  // (vFormName為帶有各FormName的字串變數)
  CaseFormName := TFormName(GetEnumValue(TypeInfo(TFormName), StrFormName));

  case CaseFormName of
    Casefm1:
      begin
        ..............
      end;

    Casefm2:
      begin
        ..............
      end;

    Casefm3: 
      begin
       ...............
      end;

【參考連結】

Jul 11

Delphi menus always seem to revert to the default font (8, Tahoma) problem,Some users abroad have asked about this,but there is no solution。Currently, the temporary workaround I can think of is to set up a function key (which can be used as a hotkey),so that when users encounter a smaller font,,they can manually reset the font size。(During testing, changing the Windows display scaling percentage can make the menu font revert to the default size)

procedure Tmainform.N93Click(Sender: TObject);
begin
  Screen.MenuFont.Size := 12;
  xxxxxx.BringToFront; // 改變畫面焦點,以刷新選單畫面。
end;

【參考連結】

Jul 11
procedure TfmQAB.FormShortCut(var Msg: TWMKey; var Handled: Boolean);
begin
if (Msg.CharCode = 116)  and (HiWord(GetKeyState(VK_CONTROL)) = 1)  then 
  begin
    ......
  end
end;

【參考連結】

Jul 11
var
  vTime, vTime1, vTime2: double;
begin
  vTime1 := GetTickCount();
  vTime2 := GetTickCount();
  vTime := (vTime2 - vTime1) / 1000;
  Showmessage(floatToStr(vTime) + 's');
end;

【參考連結】

Nov 23

  前兩週公司網路架構大翻修,忙到不可開交,在修改print server的IP時,有兩顆很機歪一開始先是不讓我改後來改好後變成只要閒置一段時間他就會斷線試了一整天最後放棄就抓了個小程式放在Server讓程式每隔30秒就對print server來ping一下

繼續瀏覽 »