好处没有这个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;