好處沒有這個API 也可以啟動程序只是調用會出錯.
function __IsNativeVhdBoot: Boolean;
type
TIsNativeVhdBoot = function(
NativeVhdBoot: pBOOL
): BOOL; stdcall;
var
bNativeVhdBoot: pBOOL;
NativeVhdBoot : TIsNativeVhdBoot;
begin
Result := False;
NativeVhdBoot := GetProcAddress(GetModuleHandle(kernel32), 'IsNativeVhdBoot');
if (@NativeVhdBoot <> nil) then
begin
if not NativeVhdBoot(bNativeVhdBoot) then
RaiseLastOSError;
Result := bNativeVhdBoot^;
end
else
RaiseLastOSError;
end;
固態調用 (沒有這個API啟動會失敗)
function IsNativeVhdBoot(NativeVhdBoot:PBOOL):BOOL; external Kernel32 name 'IsNativeVhdBoot';
function _IsNativeVhdBoot:Boolean;
var
pB:PBOOL;
begin
Result := False;
if IsNativeVhdBoot(pB) then
Result := pB^
else RaiseLastOSError;
end;
關於Delphi XE 5 中編譯DevExpress VCL中的cxDateUtils單元
編譯cxLibrary如下函數出錯:
-
function GetEraYearOffset(const Name: string): Integer;
-
var
-
I: Integer;
-
begin
-
Result := 0;
-
for I := Low(EraNames) to High(EraNames) do
-
begin
-
if EraNames[I] = '' then
-
Break;
-
if AnsiStrPos(PChar(EraNames[I]), PChar(Name)) <> nil then
-
begin
-
Result := EraYearOffsets[I];
-
Exit;
-
end;
-
end;
-
end;
是因為SysUtils做了修改,對應修改如下:
-
function GetEraYearOffset(const Name: string): Integer;
-
var
-
I: Integer;
-
begin
-
Result := 0;
-
for I := Low(FormatSettings.EraInfo) to High(FormatSettings.EraInfo) do
-
begin
-
if FormatSettings.EraInfo[I].EraName = '' then
-
Break;
-
if AnsiStrPos(PChar(FormatSettings.EraInfo[I].EraName), PChar(Name)) <> nil
-
then
-
begin
-
Result := FormatSettings.EraInfo[I].EraOffset;
-
Exit;
-
end;
-
end;
-
end;
還有一處:
-
if AnsiPos('e', AFormat.ShortDateFormat) > 0 then
-
AEraYearOffset := EraYearOffsets[ 1];
對應修改為:
-
if AnsiPos('e', AFormat.ShortDateFormat) > 0 then
-
AEraYearOffset := FormatSettings.EraInfo[ 1].EraOffset;
