diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e51e725 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.dcu +Source/Units/__history +*.local +*.identcache +*.skincfg +*.dsk +__history +*.rsm +*.dcu +*.~dsk diff --git a/README.md b/README.md index 3d3e39e..0e476af 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ It contains more than 60 components and controls for different purposes. ## Requirements * Delphi 5 (or higher) or C++ Builder 5 (or higher). +* Delphi XE10, XE11, XE12, XE12.1 or C++ Builder XE10, XE11, XE12, XE12.1 (or higher). +* Source code works on Delphi 64-bit and Delphi 32-bit. * Source code can be compiled with Delphi 3/4, but it is not guaranteed. * OS: Windows 98/Me/NT4/2000/XP/2003/Vista/7/8/10/11. @@ -29,6 +31,10 @@ the [Samples](https://github.com/abf-software/abfVCL/tree/main/Samples) folder. ## History +### May 9th, 2020. (Version 5.x Open Source): +- Updated components to work in 64-bits. +- Fixed small compile errors. + ### February 23, 2020. (Version 5.x Open Source): On 20th anniversary of ABF software, Inc. the source code of ABF Visual Components Library was released under MIT License. The source code is available diff --git a/ReadMe.txt b/ReadMe.txt index e1a3889..99916ed 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -5,6 +5,7 @@ Source code: https://github.com/abf-software/abfVCL Copyright (c) 2000-2020 ABF software, Inc. All Rights Reserved. Copyright (c) 2020 Dmytro Golovenko. MIT License. +Copyright (c) 2024 Sally Peck. MIT License. ================================================================ @@ -23,6 +24,8 @@ for different purposes. Requirements ============ * Delphi 5 (or higher) or C++ Builder 5 (or higher). +* Delphi XE10, XE11, XE12, XE12.1 or C++ Builder XE10, XE11, XE12, XE12.1 (or higher). +* Tested on x64 and x86. * Source code can be compiled with Delphi 3/4, but it is not guaranteed. * OS: Windows 98/Me/NT4/2000/XP/2003/Vista/7/8/10/11. @@ -41,6 +44,8 @@ For more information see demo projects or contact our support team. History ======= +May 9th, 2024. (Version 5.x Open Source): +- Upgraded to Delphi XE10, XE11, XE12, XE12.1 or C++ Builder XE10, XE11, XE12, XE12.1 (or higher). February 23, 2020. (Version 5.x Open Source): On 20th anniversary of ABF software, Inc. the source code of ABF Visual @@ -72,4 +77,3 @@ First public release. Copyright (c) 2000-2020 ABF software, Inc. All Rights Reserved. Copyright (c) 2020 Dmytro Golovenko. MIT License. ================================================================ - diff --git a/Source/PropertyEditors/abfAboutComponent.dfm b/Source/PropertyEditors/abfAboutComponent.dfm index 12fe1eb..47f1b65 100644 --- a/Source/PropertyEditors/abfAboutComponent.dfm +++ b/Source/PropertyEditors/abfAboutComponent.dfm @@ -12,10 +12,8 @@ object frmAboutComponent: TfrmAboutComponent Font.Height = -13 Font.Name = 'Arial' Font.Style = [fsBold] - OldCreateOrder = True Scaled = False OnMouseMove = FormMouseMove - PixelsPerInch = 96 TextHeight = 16 object lbBy: TLabel Left = 162 @@ -68,7 +66,7 @@ object frmAboutComponent: TfrmAboutComponent object lbSupport: TLabel Left = 264 Top = 174 - Width = 83 + Width = 82 Height = 16 Caption = 'xxx@yyy.zzz' Transparent = True @@ -88,7 +86,7 @@ object frmAboutComponent: TfrmAboutComponent object lbWeb: TLabel Left = 264 Top = 198 - Width = 83 + Width = 82 Height = 16 Caption = 'www.yyy.zzz' Transparent = True @@ -104,7 +102,7 @@ object frmAboutComponent: TfrmAboutComponent Height = 21 Alignment = taCenter AutoSize = False - Caption = 'Copyright ©' + Caption = 'Copyright '#169 end object bvBottom: TBevel Left = 0 diff --git a/Source/PropertyEditors/abfAboutComponent.pas b/Source/PropertyEditors/abfAboutComponent.pas index 557ef57..ec6b88a 100644 --- a/Source/PropertyEditors/abfAboutComponent.pas +++ b/Source/PropertyEditors/abfAboutComponent.pas @@ -209,6 +209,27 @@ function TfrmAboutComponent.GetEmailSubject: string; {$IfDef D9_ONLY}SDelphi = 'Delphi 2005'; {$EndIf} {$IfDef D10_ONLY}SDelphi = 'Delphi 2006'; {$EndIf} {$IfDef D11_ONLY}SDelphi = 'Delphi 2007'; {$EndIf} + +{$IfDef D12_ONLY}SDelphi = 'Delphi 2009'; {$EndIf} +{$IfDef D13_ONLY}SDelphi = 'Delphi 2010'; {$EndIf} +{$IfDef D14_ONLY}SDelphi = 'Delphi XE'; {$EndIf} +{$IfDef D15_ONLY}SDelphi = 'Delphi XE2'; {$EndIf} +{$IfDef D16_ONLY}SDelphi = 'Delphi XE3'; {$EndIf} +{$IfDef D17_ONLY}SDelphi = 'Delphi XE4'; {$EndIf} +{$IfDef D18_ONLY}SDelphi = 'Delphi XE5'; {$EndIf} +{$IfDef D19_ONLY}SDelphi = 'Delphi XE6'; {$EndIf} +{$IfDef D20_ONLY}SDelphi = 'Delphi XE7'; {$EndIf} +{$IfDef D21_ONLY}SDelphi = 'Delphi XE8'; {$EndIf} +{$IfDef D22_ONLY}SDelphi = 'Delphi XE10 (Seattle)'; {$EndIf} +{$IfDef D23_ONLY}SDelphi = 'Delphi XE10 (Berlin)'; {$EndIf} +{$IfDef D24_ONLY}SDelphi = 'Delphi XE10 (Rio)'; {$EndIf} +{$IfDef D25_ONLY}SDelphi = 'Delphi XE10 (Sydney)'; {$EndIf} +{$IfDef D26_ONLY}SDelphi = 'Delphi XE11.3 (Alexandra'; {$EndIf} +{$IfDef D27_ONLY}SDelphi = 'Delphi XE112'; {$EndIf} +{$IfDef D28_ONLY}SDelphi = 'Delphi XE12.1'; {$EndIf} +{$IfDef D29_ONLY}SDelphi = 'Delphi XE12.2 (ModernX)'; {$EndIf} +{$IfDef D30_ONLY}SDelphi = 'Delphi XE12.3 (ModernX2)'; {$EndIf} + {$IfDef C1_ONLY}SDelphi = 'C++Builder 1';{$EndIf} {$IfDef C3_ONLY}SDelphi = 'C++Builder 3';{$EndIf} {$IfDef C4_ONLY}SDelphi = 'C++Builder 4';{$EndIf} @@ -216,6 +237,7 @@ function TfrmAboutComponent.GetEmailSubject: string; {$IfDef C6_ONLY}SDelphi = 'C++Builder 6';{$EndIf} {$IfDef C10_ONLY}SDelphi = 'C++Builder 2006';{$EndIf} {$IfDef C11_ONLY}SDelphi = 'C++Builder 2007';{$EndIf} +{$IfDef C35_ONLY}SDelphi = 'C++Builder 2007';{$EndIf} begin Result := Format(SSubject, [ComponentName, SabfVCLVersion, SDelphi]); end; diff --git a/Source/Units/abfAPMUtils.pas b/Source/Units/abfAPMUtils.pas index 00b28c6..ee9a6fa 100644 --- a/Source/Units/abfAPMUtils.pas +++ b/Source/Units/abfAPMUtils.pas @@ -526,12 +526,17 @@ procedure _SetProcAddr(const LibName: string; const ProcName: string; function CallNtPowerInformation; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'CallNtPowerInformation', _CallNtPowerInformation); asm mov esp, ebp pop ebp jmp [_CallNtPowerInformation] end; +{$ELSE} + Result := CallNTPowerInformation(TPowerInformationLevel(11), nil, 0, lpOutputBuffer, OutputBufferSize); + //_CallNtPowerInformation +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -541,12 +546,15 @@ function CallNtPowerInformation; function DeletePwrScheme; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'DeletePwrScheme', _DeletePwrScheme); asm mov esp, ebp pop ebp jmp [_DeletePwrScheme] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -556,12 +564,15 @@ function DeletePwrScheme; function EnumPwrSchemes; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'EnumPwrSchemes', _EnumPwrSchemes); asm mov esp, ebp pop ebp jmp [_EnumPwrSchemes] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -571,6 +582,7 @@ function EnumPwrSchemes; function GetActivePwrScheme; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'GetActivePwrScheme', _GetActivePwrScheme); if not Assigned(_GetActivePwrScheme) then Exit; asm @@ -578,6 +590,8 @@ function GetActivePwrScheme; pop ebp jmp [_GetActivePwrScheme] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -587,6 +601,7 @@ function GetActivePwrScheme; function GetCurrentPowerPolicies; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'GetCurrentPowerPolicies', _GetCurrentPowerPolicies); if not Assigned(_GetCurrentPowerPolicies) then Exit; asm @@ -594,6 +609,8 @@ function GetCurrentPowerPolicies; pop ebp jmp [_GetCurrentPowerPolicies] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -603,6 +620,7 @@ function GetCurrentPowerPolicies; function GetPwrCapabilities; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'GetPwrCapabilities', _GetPwrCapabilities); if not Assigned(_GetPwrCapabilities) then Exit; asm @@ -610,6 +628,8 @@ function GetPwrCapabilities; pop ebp jmp [_GetPwrCapabilities] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -619,6 +639,7 @@ function GetPwrCapabilities; function GetPwrDiskSpindownRange; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'GetPwrDiskSpindownRange', _GetPwrDiskSpindownRange); if not Assigned(_GetPwrDiskSpindownRange) then Exit; asm @@ -626,6 +647,8 @@ function GetPwrDiskSpindownRange; pop ebp jmp [_GetPwrDiskSpindownRange] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -635,6 +658,7 @@ function GetPwrDiskSpindownRange; function IsPwrHibernateAllowed; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'IsPwrHibernateAllowed', _IsPwrHibernateAllowed); if not Assigned(_IsPwrHibernateAllowed) then Exit; asm @@ -642,6 +666,8 @@ function IsPwrHibernateAllowed; pop ebp jmp [_IsPwrHibernateAllowed] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -651,6 +677,7 @@ function IsPwrHibernateAllowed; function IsPwrShutdownAllowed; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'IsPwrShutdownAllowed', _IsPwrShutdownAllowed); if not Assigned(_IsPwrShutdownAllowed) then Exit; asm @@ -658,6 +685,8 @@ function IsPwrShutdownAllowed; pop ebp jmp [_IsPwrShutdownAllowed] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -667,6 +696,7 @@ function IsPwrShutdownAllowed; function IsPwrSuspendAllowed; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'IsPwrSuspendAllowed', _IsPwrSuspendAllowed); if not Assigned(_IsPwrSuspendAllowed) then Exit; asm @@ -674,6 +704,8 @@ function IsPwrSuspendAllowed; pop ebp jmp [_IsPwrSuspendAllowed] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -683,6 +715,7 @@ function IsPwrSuspendAllowed; function ReadGlobalPwrPolicy; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'ReadGlobalPwrPolicy', _ReadGlobalPwrPolicy); if not Assigned(_ReadGlobalPwrPolicy) then Exit; asm @@ -690,6 +723,8 @@ function ReadGlobalPwrPolicy; pop ebp jmp [_ReadGlobalPwrPolicy] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -699,6 +734,7 @@ function ReadGlobalPwrPolicy; function ReadPwrScheme; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'ReadPwrScheme', _ReadPwrScheme); if not Assigned(_ReadPwrScheme) then Exit; asm @@ -706,6 +742,8 @@ function ReadPwrScheme; pop ebp jmp [_ReadPwrScheme] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -715,6 +753,7 @@ function ReadPwrScheme; function SetActivePwrScheme; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'SetActivePwrScheme', _SetActivePwrScheme); if not Assigned(_SetActivePwrScheme) then Exit; asm @@ -722,6 +761,8 @@ function SetActivePwrScheme; pop ebp jmp [_SetActivePwrScheme] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -731,6 +772,7 @@ function SetActivePwrScheme; function SetSuspendState; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'SetSuspendState', _SetSuspendState); if not Assigned(_SetSuspendState) then Exit; asm @@ -738,6 +780,8 @@ function SetSuspendState; pop ebp jmp [_SetSuspendState] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -747,6 +791,7 @@ function SetSuspendState; function WriteGlobalPwrPolicy; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'WriteGlobalPwrPolicy', _WriteGlobalPwrPolicy); if not Assigned(_WriteGlobalPwrPolicy) then Exit; asm @@ -754,6 +799,8 @@ function WriteGlobalPwrPolicy; pop ebp jmp [_WriteGlobalPwrPolicy] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -763,6 +810,7 @@ function WriteGlobalPwrPolicy; function WritePwrScheme; begin +{$IFDEF WIN32} _SetProcAddr(powrprof, 'WritePwrScheme', _WritePwrScheme); if not Assigned(_WritePwrScheme) then Exit; asm @@ -770,6 +818,8 @@ function WritePwrScheme; pop ebp jmp [_WritePwrScheme] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -779,6 +829,7 @@ function WritePwrScheme; function SetThreadExecutionState; begin +{$IFDEF WIN32} _SetProcAddr(kernel32, 'SetThreadExecutionState', _SetThreadExecutionState); if not Assigned(_SetThreadExecutionState) then Exit; asm @@ -786,6 +837,8 @@ function SetThreadExecutionState; pop ebp jmp [_SetThreadExecutionState] end; +{$ELSE} +{$ENDIF} end; //------------------------------------------------------------------------------ diff --git a/Source/Units/abfAppProps.pas b/Source/Units/abfAppProps.pas index f8da5c0..25da9c0 100644 --- a/Source/Units/abfAppProps.pas +++ b/Source/Units/abfAppProps.pas @@ -287,8 +287,14 @@ TabfAppPropList = class(TObject) procedure DoDeactivate(Sender: TObject); procedure DoException(Sender: TObject; E: Exception); procedure DoIdle(Sender: TObject; var Done: Boolean); +{$IFDEF D9} + function DoHelp(Command: Word; Data: NativeInt; + var CallHelp: Boolean): Boolean; +{$ELSE} function DoHelp(Command: Word; Data: Longint; var CallHelp: Boolean): Boolean; +{$ENDIF} + procedure DoHint(Sender: TObject); procedure DoMessage(var Msg: TMsg; var Handled: Boolean); procedure DoMinimize(Sender: TObject); @@ -371,7 +377,9 @@ procedure TabfAppPropList.Add(App: TabfApplicationProperties); Application.OnDeactivate := DoDeactivate; Application.OnException := DoException; Application.OnIdle := DoIdle; +{$IFDEF D9} Application.OnHelp := DoHelp; +{$ENDIF} Application.OnHint := DoHint; Application.OnMessage := DoMessage; Application.OnMinimize := DoMinimize; @@ -519,7 +527,11 @@ procedure TabfAppPropList.DoIdle(Sender: TObject; var Done: Boolean); //------------------------------------------------------------------------------ +{$IFDEF D9} +function TabfAppPropList.DoHelp(Command: Word; Data: NativeInt; var CallHelp: Boolean): Boolean; +{$ELSE} function TabfAppPropList.DoHelp(Command: Word; Data: Longint; var CallHelp: Boolean): Boolean; +{$ENDIF} var i: Integer; begin diff --git a/Source/Units/abfClasses.pas b/Source/Units/abfClasses.pas index 66fc3fc..deebde5 100644 --- a/Source/Units/abfClasses.pas +++ b/Source/Units/abfClasses.pas @@ -51,7 +51,7 @@ interface PUSHEAX: Byte; PUSHEDX: Byte; JMP: Byte; - JmpOffset: Integer; + JmpOffset: NativeInt;//Integer; end; {$IfNDef D6} @@ -1159,7 +1159,7 @@ constructor TabfFileVersionInfo.Create(const AFileName: WideString); Win32Check(VerQueryValueW(Pointer(FBuffer), PWideChar(cVerFixedInfo), Pointer(FFixedBuffer), Size)) else - Win32Check(VerQueryValue(Pointer(FBuffer), PAnsiChar(AnsiString(cVerFixedInfo)), + Win32Check(VerQueryValueA(Pointer(FBuffer), PAnsiChar(AnsiString(cVerFixedInfo)), Pointer(FFixedBuffer), Size)); if Size < SizeOf(TVSFixedFileInfo) then RaiseLastWin32Error; ExtractLanguageIds; @@ -1191,7 +1191,7 @@ constructor TabfFileVersionInfo.CreateFromBlock(const Buffer: AnsiString; Win32Check(VerQueryValueW(PAnsiChar(FBuffer), PWideChar(cVerFixedInfo), Pointer(FFixedBuffer), Size)) else - Win32Check(VerQueryValue(PAnsiChar(FBuffer), PAnsiChar(AnsiString(cVerFixedInfo)), + Win32Check(VerQueryValueA(PAnsiChar(FBuffer), PAnsiChar(AnsiString(cVerFixedInfo)), Pointer(FFixedBuffer), Size)); if Size < SizeOf(TVSFixedFileInfo) then RaiseLastWin32Error; ExtractLanguageIds; @@ -1220,7 +1220,7 @@ class function TabfFileVersionInfo.VersionInfoExists( if IsWinNT then Result := GetFileVersionInfoSizeW(PWideChar(AFileName), Handle) > 0 else - Result := GetFileVersionInfoSize(PAnsiChar(AnsiString(AFileName)), Handle) > 0; + Result := GetFileVersionInfoSizeA(PAnsiChar(AnsiString(AFileName)), Handle) > 0; end; //------------------------------------------------------------------------------ @@ -1288,14 +1288,14 @@ procedure TabfFileVersionInfo.GetVersionInfo; if IsWinNT then Size := GetFileVersionInfoSizeW(PWideChar(FFileName), Handle) else - Size := GetFileVersionInfoSize(PAnsiChar(AnsiString(FFileName)), Handle); + Size := GetFileVersionInfoSizeA(PAnsiChar(AnsiString(FFileName)), Handle); if Size = 0 then raise EabfFileVersionInfo.Create(SabfFileVersionInfo_NoInfo); SetLength(FBuffer, Size); if IsWinNT then Win32Check(GetFileVersionInfoW(PWideChar(FFileName), Handle, Size, PAnsiChar(FBuffer))) else - Win32Check(GetFileVersionInfo(PAnsiChar(AnsiString(FFileName)), Handle, Size, + Win32Check(GetFileVersionInfoA(PAnsiChar(AnsiString(FFileName)), Handle, Size, PAnsiChar(FBuffer))); end; @@ -1313,7 +1313,7 @@ procedure TabfFileVersionInfo.ExtractLanguageIds; Res := VerQueryValueW(PAnsiChar(FBuffer), PWideChar(cVerTranslation), Pointer(Translation), Size) else - Res := VerQueryValue(PAnsiChar(FBuffer), PAnsiChar(AnsiString(cVerTranslation)), + Res := VerQueryValueA(PAnsiChar(FBuffer), PAnsiChar(AnsiString(cVerTranslation)), Pointer(Translation), Size); if Res then @@ -1381,7 +1381,7 @@ function TabfFileVersionInfo.GetLanguageNames(Index: Integer): WideString; Result := WideString(PWideChar(Buf)); end else begin - VerLanguageName(LoWord(D), PAnsiChar(Buf), BufSize); + VerLanguageNameA(LoWord(D), PAnsiChar(Buf), BufSize); Result := AnsiString(PAnsiChar(Buf)); end; finally @@ -1407,7 +1407,7 @@ function TabfFileVersionInfo.GetUserKey(const Key: WideString): WideString; Result := WideString(PWideChar(P)); end else begin - if VerQueryValue(PAnsiChar(FBuffer), PAnsiChar(AnsiString(WS)), P, Size) then + if VerQueryValueA(PAnsiChar(FBuffer), PAnsiChar(AnsiString(WS)), P, Size) then Result := AnsiString(PAnsiChar(P)); end; end; @@ -1430,7 +1430,7 @@ function TabfFileVersionInfo.GetVersionKeyValue(Index: Integer): WideString; Result := WideString(PWideChar(P)); end else begin - if VerQueryValue(PAnsiChar(FBuffer), PAnsiChar(AnsiString(WS)), P, Size) then + if VerQueryValueA(PAnsiChar(FBuffer), PAnsiChar(AnsiString(WS)), P, Size) then Result := AnsiString(PAnsiChar(P)); end; end; @@ -1710,7 +1710,7 @@ procedure TabfRegistryMonitorThread.Execute; TempKey: HKEY; rcd, rcd2: REG_CHANGE_DATA; begin - Res := RegOpenKeyEx(FRootKey, PAnsiChar(FRegistryKey), 0, KEY_READ, FKey); + Res := RegOpenKeyExA(FRootKey, PAnsiChar(FRegistryKey), 0, KEY_READ, FKey); FKeyExists := (Res = ERROR_SUCCESS); @@ -1739,7 +1739,7 @@ procedure TabfRegistryMonitorThread.Execute; WAIT_OBJECT_0: ReleaseMutex(Mutex); WAIT_OBJECT_0 + 1: begin - Res := RegOpenKeyEx(FRootKey, PAnsiChar(FRegistryKey), 0, KEY_READ, + Res := RegOpenKeyExA(FRootKey, PAnsiChar(FRegistryKey), 0, KEY_READ, TempKey); if (Res <> ERROR_SUCCESS) then begin @@ -1785,7 +1785,7 @@ procedure TabfRegistryMonitorThread.Execute; try if FWaitChanged then begin - Res := RegOpenKeyEx(FRootKey, PAnsiChar(FRegistryKey), 0, KEY_READ, FKey); + Res := RegOpenKeyExA(FRootKey, PAnsiChar(FRegistryKey), 0, KEY_READ, FKey); FKeyExists := Res = ERROR_SUCCESS; if FKeyExists then FWaitHandle := abfRegFindFirstChangeNotification(FKey, FWatchSubTree, diff --git a/Source/Units/abfComControls.pas b/Source/Units/abfComControls.pas index f07a436..47bc110 100644 --- a/Source/Units/abfComControls.pas +++ b/Source/Units/abfComControls.pas @@ -177,7 +177,11 @@ TabfCustomListView = class(TCustomListView) public constructor Create(AOwner: TComponent); override; destructor Destroy; override; +{$IFDEF WIN32} function CustomSort(SortProc: TLVCompare; Data: LongInt): Boolean; virtual; +{$ELSE} + function CustomSort(SortProc: TLVCompare; Data: NativeInt): Boolean; virtual; +{$ENDIF} procedure RepaintHeader; virtual; procedure DoAutoSizeEx(AVertScroll: Boolean); virtual; procedure DoAutoSize; virtual; @@ -617,7 +621,7 @@ procedure TabfCustomRichEdit.Print(const Caption: string); procedure TabfCustomRichEdit.ReplaceSelectedText(const NewText: string); begin if not (csDesigning in ComponentState) then if not _ASK then _TADA; - SendMessage(Handle, EM_REPLACESEL, Integer(True), Integer(PChar(NewText))); + SendMessage(Handle, EM_REPLACESEL, NativeInt(True), NativeInt(PChar(NewText))); end; //------------------------------------------------------------------------------ @@ -729,7 +733,7 @@ function _DefaultListViewCompareItems(Str1, Str2: string): Integer; // Default listview sort function function _DefaultListViewSort(Item1, Item2: TListItem; - lParam: Integer): Integer; stdcall; + lParam: NativeInt): Integer; stdcall; var Str1, Str2: string; Column: Integer; @@ -795,8 +799,13 @@ destructor TabfCustomListView.Destroy; //------------------------------------------------------------------------------ // Method for sorting by custom sort function +{$IFDEF WIN32} function TabfCustomListView.CustomSort(SortProc: TLVCompare; Data: LongInt): Boolean; +{$ELSE} +function TabfCustomListView.CustomSort(SortProc: TLVCompare; + Data: NativeInt): Boolean; +{$ENDIF} begin Result := False; if HandleAllocated then @@ -843,9 +852,9 @@ procedure TabfCustomListView.DrawSortMark; //------------------------------------------------------------------------------ - function _GetOrderIndex(Index: Integer): Integer; + function _GetOrderIndex(Index: NativeInt): Integer; var - i: Integer; + i: NativeInt; {$IfNDef D4} SectionOrder: array[0..1024] of Integer; {$Else D4} @@ -1041,7 +1050,13 @@ procedure TabfCustomListView.HookControl; if (P <> FNewWndProc) then begin FPrevWndProc := P; +{$IFDEF WIN32} SetWindowLong(Handle, GWL_WNDPROC, LongInt(FNewWndProc)); +{$ENDIF} +{$IFDEF WIN64} + SetWindowLong(Handle, GWL_WNDPROC, NativeInt(FNewWndProc)); +{$ENDIF} + end; end; @@ -1069,7 +1084,12 @@ procedure TabfCustomListView.HookWndProc(var AMsg: TMessage); else WParamLo := 0; if FSortDirection = sdAscending then WParamHi := 1 else WParamHi := Word(-1); + +{$IFDEF WIN32} LParam := Integer(@abfListViewSortProc); +{$ELSE} + LParam := NativeInt(@abfListViewSortProc); +{$ENDIF} end; Result := CallWindowProc(FPrevWndProc, Handle, Msg, WParam, LParam); end; @@ -1083,7 +1103,11 @@ procedure TabfCustomListView.HookHeader(Wnd: THandle); FHeaderHandle := Wnd; FPrevHeaderProc := Pointer(GetWindowLong(FHeaderHandle, GWL_WNDPROC)); +{$IFDEF WIN32} SetWindowLong(FHeaderHandle, GWL_WNDPROC, LongInt(FNewHeaderProc)); +{$ELSE} + SetWindowLong(FHeaderHandle, GWL_WNDPROC, NativeInt(FNewHeaderProc)); +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -1095,7 +1119,11 @@ procedure TabfCustomListView.UnhookHeader; if Assigned(FPrevHeaderProc) and (Pointer(GetWindowLong(FHeaderHandle, GWL_WNDPROC)) = FNewHeaderProc) then begin +{$IFDEF WIN32} SetWindowLong(FHeaderHandle, GWL_WNDPROC, LongInt(FPrevHeaderProc)); +{$ELSE} + SetWindowLong(FHeaderHandle, GWL_WNDPROC, NativeInt(FPrevHeaderProc)); +{$ENDIF} FPrevHeaderProc := nil; FHeaderHandle := 0; end; @@ -1118,7 +1146,11 @@ procedure TabfCustomListView.HeaderWndProc(var AMsg: TMessage); FHeadLBDown := True; Info.Point.X := TWMLButtonDown(AMsg).Pos.X; Info.Point.Y := TWMLButtonDown(AMsg).Pos.Y; - FHeadLBCol := SendMessage(FHeaderHandle, HDM_HITTEST, 0, Integer(@Info)); +{$IFDEF WIN32} + FHeadLBCol := SendMessage(FHeaderHandle, HDM_HITTEST, 0, Longint(@Info)); +{$ELSE} + FHeadLBCol := SendMessage(FHeaderHandle, HDM_HITTEST, 0, NativeInt(@Info)); +{$ENDIF} if (Info.Flags and HHT_ONDIVIDER) = 0 then FHeadOnDiv := False else diff --git a/Source/Units/abfComboBoxes.pas b/Source/Units/abfComboBoxes.pas index cffd57b..f95ae96 100644 --- a/Source/Units/abfComboBoxes.pas +++ b/Source/Units/abfComboBoxes.pas @@ -1,4 +1,4 @@ -{******************************************************************************* +{******************************************************************************* ABF Visual Components Library @@ -1278,9 +1278,15 @@ function _IsValidFont(Box: TabfFontNameComboBox; LogFont: TLogFont; //------------------------------------------------------------------------------ +{$IFDEF WIN32} function _EnumFontsProc(var EnumLogFont: TEnumLogFont; var TextMetric: TNewTextMetric; FontType: Integer; Data: LPARAM): Integer; export; stdcall; +{$ELSE} +function _EnumFontsProc(var EnumLogFont: TEnumLogFont; + var TextMetric: TNewTextMetric; FontType: Integer; Data: LPARAM): NativeInt; + export; stdcall; +{$ENDIF} var FaceName: string; begin @@ -1418,7 +1424,11 @@ procedure TabfFontNameComboBox.InitList; procedure _InitScreen; begin + {$IFDEF WIN32} EnumFontFamilies(DC, nil, @_EnumFontsProc, Longint(Self)); + {$ELSE} + EnumFontFamilies(DC, nil, @_EnumFontsProc, NativeInt(Self)); + {$ENDIF} end;{Internal procedure _InitScreen} //----------------------------------- @@ -1426,7 +1436,11 @@ procedure TabfFontNameComboBox.InitList; procedure _InitPrinter; begin try + {$IFDEF WIN32} EnumFontFamilies(Printer.Handle, nil, @_EnumFontsProc, Longint(Self)); + {$ELSE} + EnumFontFamilies(Printer.Handle, nil, @_EnumFontsProc, NativeInt(Self)); + {$ENDIF} except end; end;{Internal procedure _InitPrinter} @@ -1650,8 +1664,14 @@ function _IsFontTrueType(const FontName : string): Boolean; //------------------------------------------------------------------------------ +{$IFDEF WIN32} function _EnumFontsBySize(var LogFont: TEnumLogFont; var ptm: TNewTextMetric; FontType: Integer; Data: Pointer): Integer; stdcall; +{$ENDIF} +{$IFDEF WIN64} +function _EnumFontsBySize(var LogFont: TEnumLogFont; var ptm: TNewTextMetric; + FontType: Integer; Data: Pointer): NativeInt; stdcall; +{$ENDIF} var Str: string; i, Height: Integer; @@ -1728,7 +1748,11 @@ procedure TabfFontSizeComboBox.InitList; DC := GetDC(0); try Str := FontName; + {$IFDEF WIN32} EnumFontFamilies(DC, PChar(Str), @_EnumFontsBySize, LongInt(Items)); + {$ELSE} + EnumFontFamilies(DC, PChar(Str), @_EnumFontsBySize, NativeInt(Items)); + {$ENDIF} finally ReleaseDC(0, DC); end; diff --git a/Source/Units/abfComponents.pas b/Source/Units/abfComponents.pas index efd0b38..451f331 100644 --- a/Source/Units/abfComponents.pas +++ b/Source/Units/abfComponents.pas @@ -693,6 +693,7 @@ end;{TabfColorPicker = class(TabfCustomTimer)} PabfNotifyIconDataWVer4 = ^TabfNotifyIconDataWVer4; {$EXTERNALSYM PabfNotifyIconDataWVer4} + (* TabfNotifyIconDataAVer5 = packed record cbSize: DWORD; hWnd: HWND; @@ -735,7 +736,7 @@ end;{TabfColorPicker = class(TabfCustomTimer)} PabfNotifyIconDataWVer5 = ^TabfNotifyIconDataWVer5; {$EXTERNALSYM PabfNotifyIconDataWVer5} - TabfNotifyIconDataAVer6 = packed record + (*TabfNotifyIconDataAVer6 = packed record cbSize: DWORD; hWnd: HWND; uID: UINT; @@ -778,7 +779,7 @@ end;{TabfColorPicker = class(TabfCustomTimer)} {$EXTERNALSYM TabfNotifyIconDataWVer6} PabfNotifyIconDataWVer6 = ^TabfNotifyIconDataWVer6; {$EXTERNALSYM PabfNotifyIconDataWVer6} - + *) EabfTrayIcon = class(EabfException); TabfTrayIconInfoType = (tiiNone, tiiInfo, tiiWarning, tiiError, tiiUser); @@ -852,7 +853,7 @@ TabfTrayIcon = class(TabfCustomTimer) procedure SetInfoTimeOut(AValue: Integer); procedure SetInfoType(AValue: TabfTrayIconInfoType); protected - function CallShellNotifyIcon(AMessage: DWORD): Boolean; virtual; + function CallShellNotifyIcon(AMessage: {$IFDEF D9}NativeInt{$ELSE}DWORD{$ENDIF}): Boolean; virtual; procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure Loaded; override; @@ -1895,8 +1896,13 @@ procedure TabfWndProcHookList.Hook(const AHook: TabfCustomWndProcHook); TabfCustomWndProcHook(List[i]).FOldWndProc := TabfCustomWndProcHook(List[i - 1]).FNewWndProc; // Set proc of the last item to the window +{$IFDEF WIN32} SetWindowLong(AHandle, GWL_WNDPROC, LongInt(TabfCustomWndProcHook(List[List.Count - 1]).FNewWndProc)); +{$ELSE} + SetWindowLong(AHandle, GWL_WNDPROC, + NativeInt(TabfCustomWndProcHook(List[List.Count - 1]).FNewWndProc)); +{$ENDIF} finally List.Free; end; @@ -1921,7 +1927,11 @@ procedure TabfWndProcHookList.UnHook(const AHook: TabfCustomWndProcHook); // If there are no items in List, just set the default proc to the window if List.Count < 1 then begin + {$IFDEF WIN32} SetWindowLong(AHandle, GWL_WNDPROC, LongInt(DefaultProc)); + {$ELSE} + SetWindowLong(AHandle, GWL_WNDPROC, NativeInt(DefaultProc)); + {$ENDIF} Exit; end; // Normalize the List @@ -1930,8 +1940,13 @@ procedure TabfWndProcHookList.UnHook(const AHook: TabfCustomWndProcHook); TabfCustomWndProcHook(List[i]).FOldWndProc := TabfCustomWndProcHook(List[i - 1]).FNewWndProc; // Set proc of the last item to the window +{$IFDEF WIN32} SetWindowLong(AHandle, GWL_WNDPROC, LongInt(TabfCustomWndProcHook(List[List.Count - 1]).FNewWndProc)); +{$ELSE} + SetWindowLong(AHandle, GWL_WNDPROC, + NativeInt(TabfCustomWndProcHook(List[List.Count - 1]).FNewWndProc)); +{$ENDIF} finally List.Free; end; @@ -3552,19 +3567,19 @@ function TabfTrayIcon.ShowCustomInfo(AType: TabfTrayIconInfoType; // Fill extended info members if IsWinNT then - with PabfNotifyIconDataWVer5(FNotifyIconData)^ do + with PNotifyIconDataW(FNotifyIconData)^ do begin dwInfoFlags := DWORD(AType); if FInfoNoSound then dwInfoFlags := dwInfoFlags or NIIF_NOSOUND; uFlags := NIF_INFO; uTimeout := InfoTimeOut; - Move(PWideChar(AText)^, szInfo, Min((SizeOf(szInfo) - 1), + Move(PWideChar(AText)^, szInfo, Min((length(szInfo) - 1), Length(AText) * 2)); - Move(PWideChar(ATitle)^, szInfoTitle, Min((SizeOf(szInfoTitle) - 1), + Move(PWideChar(ATitle)^, szInfoTitle, Min((length(szInfoTitle) - 1), Length(ATitle) * 2)); - end - else + end; + (*else with PabfNotifyIconDataAVer5(FNotifyIconData)^ do begin dwInfoFlags := DWORD(AType); @@ -3577,7 +3592,7 @@ function TabfTrayIcon.ShowCustomInfo(AType: TabfTrayIconInfoType; Move(PChar(string(ATitle))^, szInfoTitle, Min((SizeOf(szInfoTitle) - 1), Length(ATitle))); end; - + *) // Show a balloon Result := CallShellNotifyIcon(NIM_MODIFY); end; @@ -3598,7 +3613,7 @@ function TabfTrayIcon.ShowBalloon: Boolean; //------------------------------------------------------------------------------ -function TabfTrayIcon.CallShellNotifyIcon(AMessage: DWORD): Boolean; +function TabfTrayIcon.CallShellNotifyIcon(AMessage: {$IFDEF D9}NativeInt{$ELSE}DWORD{$ENDIF}): Boolean; begin Result := False; if not Assigned(FNotifyIconData) then Exit; @@ -3752,16 +3767,16 @@ function TabfTrayIcon.PrepareNotifyIconData: Boolean; if (TempShellVer >= $00050000) and (TempShellVer < $00060000) then begin if IsWinNT then - TempSize := SizeOf(TabfNotifyIconDataWVer5) + TempSize := SizeOf(_NOTIFYICONDATAA) else - TempSize := SizeOf(TabfNotifyIconDataAVer5); + TempSize := SizeOf(_NOTIFYICONDATAA); end else if (TempShellVer >= $00060000) then begin if IsWinNT then - TempSize := SizeOf(TabfNotifyIconDataWVer6) + TempSize := SizeOf(_NOTIFYICONDATAA) else - TempSize := SizeOf(TabfNotifyIconDataAVer6); + TempSize := SizeOf(_NOTIFYICONDATAA); end; if TempSize < 4 then Exit; @@ -3812,18 +3827,18 @@ function TabfTrayIcon.PrepareNotifyIconData: Boolean; if IsWinNT then begin - with PabfNotifyIconDataWVer5(FNotifyIconData)^ do + with PNotifyIconDataW(FNotifyIconData)^ do begin if ShowHint then - Move(PWideChar(FHint)^, szTip, Min((SizeOf(szTip) - 1), + Move(PWideChar(FHint)^, szTip, Min((Length(szTip) - 1), Length(FHint) * 2)); end end else begin - with PabfNotifyIconDataAVer5(FNotifyIconData)^ do + with PNotifyIconDataA(FNotifyIconData)^ do begin if ShowHint then - Move(PChar(string(FHint))^, szTip, Min((SizeOf(szTip) - 1), + Move(PChar(string(FHint))^, szTip, Min((Length(szTip) - 1), Length(FHint))); end end; @@ -3861,7 +3876,11 @@ procedure TabfTrayIcon.HookApp; if (csDesigning in ComponentState) then Exit; FOldAppProc := Pointer(GetWindowLong(Application.Handle, GWL_WNDPROC)); FNewAppProc := MakeObjectInstance(HookAppProc); +{$IFDEF WIN32} SetWindowLong(Application.Handle, GWL_WNDPROC, LongInt(FNewAppProc)); +{$ELSE} + SetWindowLong(Application.Handle, GWL_WNDPROC, NativeInt(FNewAppProc)); +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -3869,7 +3888,11 @@ procedure TabfTrayIcon.HookApp; procedure TabfTrayIcon.UnhookApp; begin if Assigned(FOldAppProc) then +{$IFDEF WIN32} SetWindowLong(Application.Handle, GWL_WNDPROC, LongInt(FOldAppProc)); +{$ELSE} + SetWindowLong(Application.Handle, GWL_WNDPROC, NativeInt(FOldAppProc)); +{$ENDIF} if Assigned(FNewAppProc) then FreeObjectInstance(FNewAppProc); FNewAppProc := nil; FOldAppProc := nil; @@ -4243,14 +4266,14 @@ function TabfOneInstance.AlreadyRun: Boolean; if IsWinNT then Mutex := CreateMutexW(nil, True, PWideChar(WS + 'CriticalSection')) // don't localize else - Mutex := CreateMutex(nil, True, PAnsiChar(AnsiString(WS) + 'CriticalSection')); // don't localize + Mutex := CreateMutexA(nil, True, PAnsiChar(AnsiString(WS) + 'CriticalSection')); // don't localize if (GetLastError <> 0) or (Mutex = 0) then Exit; if IsWinNT then _OneInstanceMutex := CreateMutexW(nil, False, PWideChar(WS + 'Default')) // don't localize else - _OneInstanceMutex := CreateMutex(nil, False, PAnsiChar(AnsiString(WS) + 'Default')); // don't localize + _OneInstanceMutex := CreateMutexA(nil, False, PAnsiChar(AnsiString(WS) + 'Default')); // don't localize Flag := WaitForSingleObject(_OneInstanceMutex, 0); Result := (Flag = WAIT_TIMEOUT); diff --git a/Source/Units/abfControls.pas b/Source/Units/abfControls.pas index af7119c..dff82c3 100644 --- a/Source/Units/abfControls.pas +++ b/Source/Units/abfControls.pas @@ -3723,7 +3723,7 @@ procedure TabfCustomDatePanel.InitMonthNames; BeginUpdate; try for i := Count + 1 to 12 do - Add(LongMonthNames[i]); + Add({$IFDEF DFMT}FormatSettings.{$ENDIF}LongMonthNames[i]); finally EndUpdate; end; @@ -4142,7 +4142,7 @@ procedure TabfCustomDatePanel.SetControlsLayout(Value: TabfDatePanelLayout); if ControlsLayout = dplSystemDefault then begin FInternalControlsLayout := dplDMY; - S := abfLeaveCharset(['d', 'm', 'y'], AnsiLowerCase(ShortDateFormat)); + S := abfLeaveCharset(['d', 'm', 'y'], AnsiLowerCase({$IFDEF DFMT}FormatSettings.{$ENDIF}ShortDateFormat)); abfReplaceSubStrings(S, 'dd', 'd'); abfReplaceSubStrings(S, 'mm', 'm'); abfReplaceSubStrings(S, 'yy', 'y'); diff --git a/Source/Units/abfDialogs.pas b/Source/Units/abfDialogs.pas index 63730dd..672d7bb 100644 --- a/Source/Units/abfDialogs.pas +++ b/Source/Units/abfDialogs.pas @@ -813,16 +813,16 @@ function TabfMessageForm.GetFormText: string; @SMsgDlgInformation, @SMsgDlgConfirm, nil); ButtonCaptions: array[TMsgDlgBtn] of Pointer = (@SMsgDlgYes, @SMsgDlgNo, @SMsgDlgOK, @SMsgDlgCancel, @SMsgDlgAbort, @SMsgDlgRetry, @SMsgDlgIgnore, - @SMsgDlgAll, @SMsgDlgNoToAll, @SMsgDlgYesToAll, @SMsgDlgHelp); + @SMsgDlgAll, @SMsgDlgNoToAll, @SMsgDlgYesToAll, @SMsgDlgHelp{$IFDEF D9},@SMsgDlgHelpNone{$ENDIF}); {$EndIf D3} IconIDs: array[TMsgDlgType] of PChar = (IDI_EXCLAMATION, IDI_HAND, IDI_ASTERISK, IDI_QUESTION, nil); ButtonNames: array[TMsgDlgBtn] of string = ('Yes', 'No', 'OK', 'Cancel', 'Abort', 'Retry', 'Ignore', 'All',{$IfDef D3}'NoToAll', 'YesToAll',{$EndIf} - 'Help'); + 'Help'{$IFDEF D9}, ''{$ENDIF}); ModalResults: array[TMsgDlgBtn] of Integer = (mrYes, mrNo, mrOk, mrCancel, mrAbort, mrRetry, mrIgnore, mrAll,{$IfDef D3}mrNoToAll, mrYesToAll,{$EndIf} - 0); + 0, 0); var ButtonWidths: array[TMsgDlgBtn] of Integer; // initialized to zero @@ -1960,7 +1960,7 @@ function TabfCplDlg.Execute: Boolean; // Execute CmdLine := 'control.exe ' + CmdLine; - Result := WinExec(PChar(CmdLine), SW_ShowNormal) > 31; + Result := WinExec(PAnsiChar(AnsiString(CmdLine)), SW_ShowNormal) > 31; end; //------------------------------------------------------------------------------ @@ -2066,7 +2066,7 @@ function TabfOpenWithDlg.Execute: Boolean; CmdLine: string; begin CmdLine :='rundll32.exe shell32.dll,OpenAs_RunDLL ' + FileName; - Result := WinExec(PChar(CmdLine), 0) > 31; + Result := WinExec(PAnsiChar(AnsiString(CmdLine)), 0) > 31; end; @@ -2325,8 +2325,8 @@ function TabfFindDlg.FindFiles: Boolean; function TabfCreateShortcutDlg.Execute: Boolean; begin - Result := WinExec(PChar('rundll32 appwiz.cpl,NewLinkHere ' + - abfAddSlash(Directory)), SW_SHOWNORMAL) > 31;{} + Result := WinExec(PAnsiChar(AnsiString('rundll32 appwiz.cpl,NewLinkHere ' + + abfAddSlash(Directory))), SW_SHOWNORMAL) > 31;{} end; diff --git a/Source/Units/abfEdits.pas b/Source/Units/abfEdits.pas index 7a2da02..a76000c 100644 --- a/Source/Units/abfEdits.pas +++ b/Source/Units/abfEdits.pas @@ -1217,7 +1217,11 @@ procedure TabfCustomAdvancedEdit.UpdateButton; R := Rect(3, 0, ClientWidth - ButtonWidth - 2, ClientHeight + 1) else R := Rect(ButtonWidth + 2, 0, ClientWidth - 3, ClientHeight + 1); +{$IFDEF WIN32} SendMessage(Handle, EM_SETRECTNP, 0, LongInt(@R)) +{$ELSE} + SendMessage(Handle, EM_SETRECTNP, 0, NativeInt(@R)) +{$ENDIF} end else SendMessage(Handle, EM_SETRECTNP, 0, 0); diff --git a/Source/Units/abfEffects.pas b/Source/Units/abfEffects.pas index 37a5dc8..6c989e1 100644 --- a/Source/Units/abfEffects.pas +++ b/Source/Units/abfEffects.pas @@ -3861,10 +3861,10 @@ procedure TabfCustomCredits.ResetCredits; // Resize FCreditsBitmap and render credits text with FCreditsBitmap do begin - with Credits.TextExtent(Canvas) do + //with Credits.TextExtent(Canvas) do begin - Width := cx; - Height := cy + 10; + Width := Credits.TextExtent(Canvas).cx; + Height := Credits.TextExtent(Canvas).cy + 10; end; Canvas.Brush.Color := Self.Color; Canvas.FillRect(Rect(0, 0, Width, Height)); diff --git a/Source/Units/abfGraphics.pas b/Source/Units/abfGraphics.pas index 811dd92..6c9f8ef 100644 --- a/Source/Units/abfGraphics.pas +++ b/Source/Units/abfGraphics.pas @@ -171,8 +171,8 @@ function abfGetAverageCharSize(Canvas: TCanvas): TPoint; function abfGetIconFromInstanceA(AInstance: HINST; AResName: PAnsiChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; -function abfGetIconFromInstance(AInstance: HINST; AResName: PChar; - ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; +//function abfGetIconFromInstance(AInstance: HINST; AResName: PAnsiChar; +// ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; function abfGetIconFromInstanceW(AInstance: HINST; AResName: PWideChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; @@ -183,8 +183,8 @@ function abfGetIconFromInstanceW(AInstance: HINST; AResName: PWideChar; function abfGetIconFromLibraryA(const ALibFileName: AnsiString; AResName: PAnsiChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; -function abfGetIconFromLibrary(const ALibFileName: string; AResName: PChar; - ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; +//function abfGetIconFromLibrary(const ALibFileName: string; AResName: PChar; +// ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; function abfGetIconFromLibraryW(const ALibFileName: WideString; AResName: PWideChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; @@ -197,7 +197,7 @@ function abfGetIconFromLibraryW(const ALibFileName: WideString; function abfLoadIconFromInstanceA(AInstance: HINST; AResName: PAnsiChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer; AOutputIcon: TIcon): Boolean; -function abfLoadIconFromInstance(AInstance: HINST; AResName: PChar; +function abfLoadIconFromInstance(AInstance: HINST; AResName: PAnsiChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer; AOutputIcon: TIcon): Boolean; function abfLoadIconFromInstanceW(AInstance: HINST; AResName: PWideChar; @@ -212,9 +212,9 @@ function abfLoadIconFromInstanceW(AInstance: HINST; AResName: PWideChar; function abfLoadIconFromLibraryA(const ALibFileName: AnsiString; AResName: PAnsiChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer; AOutputIcon: TIcon): Boolean; -function abfLoadIconFromLibrary(const ALibFileName: string; AResName: PChar; - ARequestedIconSize: TPoint; ARequestedIconBPP: Integer; - AOutputIcon: TIcon): Boolean; +//function abfLoadIconFromLibrary(const ALibFileName: string; AResName: PChar; + //ARequestedIconSize: TPoint; ARequestedIconBPP: Integer; + //AOutputIcon: TIcon): Boolean; function abfLoadIconFromLibraryW(const ALibFileName: WideString; AResName: PWideChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer; AOutputIcon: TIcon): Boolean; @@ -647,20 +647,23 @@ function _GetIconFromInstance(AInstance: HINST; ARsrc: HRSRC; function abfGetIconFromInstanceA(AInstance: HINST; AResName: PAnsiChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; +var + b: HRSRC; begin + b := FindResourceA(AInstance, AResName, PAnsiChar(RT_GROUP_ICON)); Result := _GetIconFromInstance(AInstance, - FindResource(AInstance, AResName, RT_GROUP_ICON), ARequestedIconSize, + b, ARequestedIconSize, ARequestedIconBPP); end; //------------------------------------------------------------------------------ -function abfGetIconFromInstance(AInstance: HINST; AResName: PChar; +{function abfGetIconFromInstance(AInstance: HINST; AResName: PAnsiChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; begin Result := abfGetIconFromInstanceA(AInstance, AResName, ARequestedIconSize, ARequestedIconBPP); -end; +end;} //------------------------------------------------------------------------------ @@ -713,12 +716,12 @@ function abfGetIconFromLibraryA(const ALibFileName: AnsiString; //------------------------------------------------------------------------------ -function abfGetIconFromLibrary(const ALibFileName: string; AResName: PChar; +{function abfGetIconFromLibrary(const ALibFileName: string; AResName: PChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer): HICON; begin Result := abfGetIconFromLibraryA(ALibFileName, AResName, ARequestedIconSize, ARequestedIconBPP); -end; +end;} //------------------------------------------------------------------------------ @@ -773,7 +776,7 @@ function abfLoadIconFromInstanceA(AInstance: HINST; AResName: PAnsiChar; //------------------------------------------------------------------------------ -function abfLoadIconFromInstance(AInstance: HINST; AResName: PChar; +function abfLoadIconFromInstance(AInstance: HINST; AResName: PAnsiChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer; AOutputIcon: TIcon): Boolean; begin @@ -829,13 +832,13 @@ function abfLoadIconFromLibraryA(const ALibFileName: AnsiString; //------------------------------------------------------------------------------ -function abfLoadIconFromLibrary(const ALibFileName: string; AResName: PChar; +{function abfLoadIconFromLibrary(const ALibFileName: string; AResName: PChar; ARequestedIconSize: TPoint; ARequestedIconBPP: Integer; AOutputIcon: TIcon): Boolean; begin Result := abfLoadIconFromLibraryA(ALibFileName, AResName, ARequestedIconSize, ARequestedIconBPP, AOutputIcon); -end; +end;} //------------------------------------------------------------------------------ diff --git a/Source/Units/abfIDEUtils.pas b/Source/Units/abfIDEUtils.pas index 311af61..5d91822 100644 --- a/Source/Units/abfIDEUtils.pas +++ b/Source/Units/abfIDEUtils.pas @@ -1729,7 +1729,7 @@ function abfGetPackageDescriptionA(const AFileName: AnsiString): AnsiString; if ResModule = 0 then Exit; try - ResInfo := FindResourceA(ResModule, 'DESCRIPTION', RT_RCDATA); + ResInfo := FindResourceA(ResModule, 'DESCRIPTION', PAnsiChar(RT_RCDATA)); if ResInfo <> 0 then begin ResData := LoadResource(ResModule, ResInfo); @@ -1780,7 +1780,7 @@ function abfGetPackageDescriptionW(const AFileName: WideString): WideString; if ResModule = 0 then Exit; try - ResInfo := FindResourceA(ResModule, 'DESCRIPTION', RT_RCDATA); + ResInfo := FindResourceA(ResModule, 'DESCRIPTION', PAnsiChar(RT_RCDATA)); if ResInfo <> 0 then begin ResData := LoadResource(ResModule, ResInfo); diff --git a/Source/Units/abfIniFiles.pas b/Source/Units/abfIniFiles.pas index ee37f09..dcc51ea 100644 --- a/Source/Units/abfIniFiles.pas +++ b/Source/Units/abfIniFiles.pas @@ -206,17 +206,22 @@ procedure TabfIniFile.SetStrings(List: TStrings); //------------------------------------- - function _TrimAroundEqual(const S: string): string; + function _TrimAroundEqual(const S: string): widestring; var P: Integer; - Name: string; + Name: widestring; begin Result := {Trim}(S); P := AnsiPos('=', Result); if P <= 0 then Exit; Name := Result; - abfDeleteAfterChar(Name, '='); - abfDeleteBeforeChar(Result, '='); +{$IFDEF D9} + abfDeleteAfterCharW(Name, '='); + abfDeleteBeforeCharW(Result, '='); +{$ELSE} + abfDeleteAfterCharA(Name, '='); + abfDeleteBeforeCharA(Result, '='); +{$ENDIF} Result := TrimRight(Name) + '=' + TrimLeft(Result); end;{Internal _TrimAroundEqual} diff --git a/Source/Units/abfKnownFolders.pas b/Source/Units/abfKnownFolders.pas index 80b3513..4579d0e 100644 --- a/Source/Units/abfKnownFolders.pas +++ b/Source/Units/abfKnownFolders.pas @@ -21,6 +21,13 @@ interface const CLSID_KnownFolderManager: TGUID = '{4DF0C730-DF9D-4AE3-9153-AA6B82E9795A}'; + +{$IFDEF D9} +type + KNOWNFOLDERID = TGuid; + REFKNOWNFOLDERID = TGuid; + PKNOWNFOLDERID = ^KNOWNFOLDERID; +{$ENDIF} type PFOLDERTYPEID = ^FOLDERTYPEID; FOLDERTYPEID = TGUID; diff --git a/Source/Units/abfMenus.pas b/Source/Units/abfMenus.pas index 1d2a458..e52823f 100644 --- a/Source/Units/abfMenus.pas +++ b/Source/Units/abfMenus.pas @@ -442,14 +442,19 @@ procedure TabfSystemMenuItem.Remove; var Menu: HMENU; Buff: array[1..255] of Char; - S: string; + S: widestring; begin inherited Remove; if not Assigned(MenuItem) then Exit; Menu := MenuHandle; GetMenuString(Menu, Command, @Buff, SizeOf(Buff), MF_BYCOMMAND); +{$IFDEF WIN32} S := StrPas(@Buff); - abfDeleteAfterChar(S, #9); + abfDeleteAfterCharW(S, #9); +{$ELSE} + S := Buff; + abfDeleteAfterCharW(S, #9); +{$ENDIF} if (AnsiCompareText(MenuItem.Caption, S) = 0) or (MenuItem.Caption = '-') then RemoveMenu(Menu, Command, MF_BYCOMMAND); end; @@ -556,7 +561,7 @@ procedure TabfSystemMenuInserter.Remove; var Menu: HMENU; Buff: array[1..255] of Char; - S: string; + S: widestring; i: Integer; begin inherited Remove; @@ -566,8 +571,13 @@ procedure TabfSystemMenuInserter.Remove; for i := 0 to Items.Count - 1 do begin GetMenuString(Menu, Items[i].Command, @Buff, SizeOf(Buff), MF_BYCOMMAND); +{$IFDEF D9} + S := Buff; + abfDeleteAfterCharW(S, #9); +{$ELSE} S := StrPas(@Buff); abfDeleteAfterChar(S, #9); +{$ENDIF} if (AnsiCompareText(Items[i].Caption, S) = 0) or (Items[i].Caption = '-') then RemoveMenu(Menu, Items[i].Command, MF_BYCOMMAND); diff --git a/Source/Units/abfRegistry.pas b/Source/Units/abfRegistry.pas index 28e5223..e2e03bb 100644 --- a/Source/Units/abfRegistry.pas +++ b/Source/Units/abfRegistry.pas @@ -15,7 +15,7 @@ interface uses - Windows, Classes, Registry, SysUtils; + Windows, Classes, Registry, SysUtils, System.SysConst; const (* @@ -76,6 +76,10 @@ interface const cAllValueType = [rdString..High(TabfRegDataType)]; +{$IFDEF D9} +resourcestring + SRegGetDataFailed = 'Registry Data Failed %s'; +{$ENDIF} type TabfRegRootKey = (rrkClassesRoot, rrkCurrentUser, rrkLocalMachine, rrkUsers, diff --git a/Source/Units/abfShlObj.pas b/Source/Units/abfShlObj.pas index 45ca0c2..2f14e7e 100644 --- a/Source/Units/abfShlObj.pas +++ b/Source/Units/abfShlObj.pas @@ -52,8 +52,8 @@ _ITEMIDLIST = record function SHGetPathFromIDListA(pidl: PItemIDList; pszPath: PAnsiChar): BOOL; stdcall; {$EXTERNALSYM SHGetPathFromIDListA} -function SHGetPathFromIDList(pidl: PItemIDList; pszPath: PChar): BOOL; stdcall; -{$EXTERNALSYM SHGetPathFromIDList} +//function SHGetPathFromIDList(pidl: PItemIDList; pszPath: PChar): BOOL; stdcall; +{.$EXTERNALSYM SHGetPathFromIDList} function SHGetPathFromIDListW(pidl: PItemIDList; pszPath: PWideChar): BOOL; stdcall; {$EXTERNALSYM SHGetPathFromIDListW} @@ -65,9 +65,9 @@ function SHGetSpecialFolderLocation(hwndOwner: HWND; nFolder: Integer; function SHGetSpecialFolderPathA(hwndOwner: HWND; lpszPath: PAnsiChar; nFolder: Integer; fCreate: BOOL): BOOL; stdcall; {$EXTERNALSYM SHGetSpecialFolderPathA} -function SHGetSpecialFolderPath(hwndOwner: HWND; lpszPath: PChar; - nFolder: Integer; fCreate: BOOL): BOOL; stdcall; -{$EXTERNALSYM SHGetSpecialFolderPath} +//function SHGetSpecialFolderPath(hwndOwner: HWND; lpszPath: PChar; + //nFolder: Integer; fCreate: BOOL): BOOL; stdcall; +{.$EXTERNALSYM SHGetSpecialFolderPath} function SHGetSpecialFolderPathW(hwndOwner: HWND; lpszPath: PWideChar; nFolder: Integer; fCreate: BOOL): BOOL; stdcall; {$EXTERNALSYM SHGetSpecialFolderPathW} @@ -137,10 +137,10 @@ function SHGetPathFromIDListA(pidl: PItemIDList; pszPath: PAnsiChar): BOOL; //------------------------------------------------------------------------------ -function SHGetPathFromIDList(pidl: PItemIDList; pszPath: PChar): BOOL; +{function SHGetPathFromIDList(pidl: PItemIDList; pszPath: PChar): BOOL; begin Result := SHGetPathFromIDListA(pidl, pszPath); -end; +end;} //------------------------------------------------------------------------------ @@ -214,11 +214,11 @@ function SHGetSpecialFolderPathA(hwndOwner: HWND; lpszPath: PAnsiChar; //------------------------------------------------------------------------------ -function SHGetSpecialFolderPath(hwndOwner: HWND; lpszPath: PChar; +{function SHGetSpecialFolderPath(hwndOwner: HWND; lpszPath: PChar; nFolder: Integer; fCreate: BOOL): BOOL; begin Result := SHGetSpecialFolderPathA(hwndOwner, lpszPath, nFolder, fCreate); -end; +end;} //------------------------------------------------------------------------------ diff --git a/Source/Units/abfShlUtils.pas b/Source/Units/abfShlUtils.pas index c5fe202..e94e464 100644 --- a/Source/Units/abfShlUtils.pas +++ b/Source/Units/abfShlUtils.pas @@ -390,7 +390,7 @@ function abfGetKnownFolderPathW(AKFID: KNOWNFOLDERID; TempFlag := TempFlag or KF_FLAG_CREATE; TempPath := nil; - if not Succeeded(SHGetKnownFolderPath(@AKFID, TempFlag, 0, TempPath)) then Exit; + if not Succeeded(SHGetKnownFolderPath(AKFID, TempFlag, 0, TempPath)) then Exit; try Result := WideString(TempPath); finally diff --git a/Source/Units/abfStatusBars.pas b/Source/Units/abfStatusBars.pas index 42a69ff..ff4fab5 100644 --- a/Source/Units/abfStatusBars.pas +++ b/Source/Units/abfStatusBars.pas @@ -1672,7 +1672,13 @@ procedure TabfStatusBar.CreateWnd; if FSimplePanel then begin if FSimpleText <> '' then +{$IFDEF WIN32} SendMessage(Handle, SB_SETTEXT, 255, Integer(PChar(FSimpleText))); +{$ENDIF} +{$IFDEF WIN64} + SendMessage(Handle, SB_SETTEXT, 255, NativeInt(PChar(FSimpleText))); +{$ENDIF} + SendMessage(Handle, SB_SIMPLE, 1, 0); end; @@ -1769,11 +1775,19 @@ procedure TabfStatusBar.DrawPanel(Panel: TabfStatusPanel; const Rect: TRect); begin if Panel.PanelStyle = apsOwnerDraw then begin +{$IFDEF WIN32} if not Boolean(SendMessage(Handle, SB_GETRECT, Panel.Index, Integer(@Panel.FLastRect))) then Panel.FLastRect := Rect else InflateRect(Panel.FLastRect, -1, -1); +{$ELSE} + if not Boolean(SendMessage(Handle, SB_GETRECT, Panel.Index, + NativeInt(@Panel.FLastRect))) then + Panel.FLastRect := Rect + else + InflateRect(Panel.FLastRect, -1, -1); +{$ENDIF} {$IfDef D4} if Panel.UseRightToLeftReading then @@ -1793,8 +1807,13 @@ procedure TabfStatusBar.DrawPanel(Panel: TabfStatusPanel; const Rect: TRect); end else begin +{$IFDEF WIN32} if Boolean(SendMessage(Handle, SB_GETRECT, Panel.Index, Integer(@Panel.FLastRect))) then +{$ELSE} + if Boolean(SendMessage(Handle, SB_GETRECT, Panel.Index, + NativeInt(@Panel.FLastRect))) then +{$ENDIF} begin {$IfDef D4} if Panel.UseRightToLeftReading then @@ -2186,8 +2205,14 @@ procedure TabfStatusBar.UpdatePanel(Index: Integer; Repaint: Boolean); if not Repaint then begin FUpdateNeeded := True; +{$IFDEF WIN32} SendMessage(Handle, SB_GETRECT, Index, Integer(@FLastRect)); InvalidateRect(Handle, @FLastRect, True); +{$ENDIF} +{$IFDEF WIN64} + SendMessage(Handle, SB_GETRECT, Index, NativeInt(@FLastRect)); + InvalidateRect(Handle, @FLastRect, True); +{$ENDIF} Exit; end else if not FUpdateNeeded then Exit; @@ -2214,7 +2239,13 @@ procedure TabfStatusBar.UpdatePanel(Index: Integer; Repaint: Boolean); end; {$EndIf D4} +{$IFDEF WIN32} SendMessage(Handle, SB_SETTEXT, Index or Flags, Integer(PChar(S))); +{$ENDIF} +{$IFDEF WIN64} + SendMessage(Handle, SB_SETTEXT, Index or Flags, NativeInt(PChar(S))); +{$ENDIF} + end; end; @@ -2236,8 +2267,14 @@ procedure TabfStatusBar.UpdatePanels(UpdateRects, UpdateText: Boolean); if Count = 0 then begin PanelEdges[0] := -1; +{$IFDEF WIN32} SendMessage(Handle, SB_SETPARTS, 1, Integer(@PanelEdges)); SendMessage(Handle, SB_SETTEXT, 0, Integer(PChar(''))); +{$ENDIF} +{$IFDEF WIN64} + SendMessage(Handle, SB_SETPARTS, 1, NativeInt(@PanelEdges)); + SendMessage(Handle, SB_SETTEXT, 0, NativeInt(PChar(''))); +{$ENDIF} end else begin PanelPos := 0; @@ -2247,7 +2284,12 @@ procedure TabfStatusBar.UpdatePanels(UpdateRects, UpdateText: Boolean); PanelEdges[i] := PanelPos; end; PanelEdges[Count - 1] := -1; +{$IFDEF WIN32} SendMessage(Handle, SB_SETPARTS, Count, Integer(@PanelEdges)); +{$ENDIF} +{$IFDEF WIN64} + SendMessage(Handle, SB_SETPARTS, Count, NativeInt(@PanelEdges)); +{$ENDIF} end; end; @@ -2278,9 +2320,16 @@ procedure TabfStatusBar.UpdateSimpleText; if not HandleAllocated then Exit; FCanvas.Brush.Color := Color; FCanvas.Brush.Style := bsSolid; +{$IFDEF WIN32} SendMessage(Handle, SB_SETTEXT, 255 {$IfDef D4}or RTLREADING[UseRightToLeftReading]{$EndIf}, Integer(PChar(FSimpleText))); +{$ENDIF} +{$IFDEF WIN64} + SendMessage(Handle, SB_SETTEXT, 255 + {$IfDef D4}or RTLREADING[UseRightToLeftReading]{$EndIf}, + NativeInt(PChar(FSimpleText))); +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -2430,7 +2479,12 @@ procedure TabfStatusBar.CMHintShow(var Message: TMessage); HintInfo: ^THintInfo; begin inherited; +{$IFDEF WIN32} Integer(HintInfo) := Message.LParam; +{$ENDIF} +{$IFDEF WIN64} + NativeInt(HintInfo) := Message.LParam; +{$ENDIF} {$IfNDef D3} HintInfo^.HintPos := ClientToScreen(HintInfo^.CursorPos); HintInfo^.HintPos.y := HintInfo^.HintPos.y + HintInfo^.CursorRect.Bottom - diff --git a/Source/Units/abfStrUtils.pas b/Source/Units/abfStrUtils.pas index 45bca41..9d69f8a 100644 --- a/Source/Units/abfStrUtils.pas +++ b/Source/Units/abfStrUtils.pas @@ -202,20 +202,20 @@ function abfAddCharBeforeW(const S: WideString; C: WideChar): WideString; // Deletes a part of the S string after the C character occurred after the // FromPos position. procedure abfDeleteAfterCharExA(var S: AnsiString; C: AnsiChar; FromPos: Integer); -procedure abfDeleteAfterCharEx(var S: string; C: Char; FromPos: Integer); +//procedure abfDeleteAfterCharEx(var S: string; C: Char; FromPos: Integer); procedure abfDeleteAfterCharExW(var S: WideString; C: WideChar; FromPos: Integer); //------------------------------------------------------------------------------ // Deletes a part of the S string before the C character occurred after the // FromPos position. procedure abfDeleteBeforeCharExA(var S: AnsiString; C: AnsiChar; FromPos: Integer); -procedure abfDeleteBeforeCharEx(var S: string; C: Char; FromPos: Integer); +//procedure abfDeleteBeforeCharEx(var S: string; C: Char; FromPos: Integer); procedure abfDeleteBeforeCharExW(var S: WideString; C: WideChar; FromPos: Integer); //------------------------------------------------------------------------------ // Deletes a part of the S string after the C char. procedure abfDeleteAfterCharA(var S: AnsiString; C: AnsiChar); -procedure abfDeleteAfterChar(var S: string; C: Char); +//procedure abfDeleteAfterChar(var S: string; C: Char); procedure abfDeleteAfterCharW(var S: WideString; C: WideChar); //------------------------------------------------------------------------------ @@ -666,6 +666,7 @@ function Utf8ToAnsi(const S: UTF8String): string; //Slightly modified copy of Fastcode function PosEx_JOH_IA32_8 function abfPosExA(const SubStr, S: AnsiString; From: Integer = 1): Integer; +(* asm {299 Bytes} sub esp, 20 mov [esp], ebx @@ -774,6 +775,9 @@ function abfPosExA(const SubStr, S: AnsiString; From: Integer = 1): Integer; cmp eax, [edx+ebx-4] je @@CompareLoop {Match on Next 4 Characters} jmp @@MainLoop {No Match} +*) +begin + Result := pos(SubStr, S, From); end; //------------------------------------------------------------------------------ @@ -787,117 +791,8 @@ function abfPosEx(const SubStr, S: string; From: Integer = 1): Integer; //Modified copy of Fastcode function PosEx_JOH_IA32_8 function abfPosExW(const SubStr, S: WideString; From: Integer = 1): Integer; -asm - sub esp, 20 - mov [esp], ebx - cmp eax, 1 - sbb ebx, ebx {-1 if SubStr = '' else 0} - sub edx, 1 {-1 if S = ''} - sbb ebx, 0 {Negative if S = '' or SubStr = '' else 0} - sub ecx, 1 {From - 1} - shl ecx, 1 - or ebx, ecx {Negative if S = '' or SubStr = '' or From < 1} - jl @@InvalidInput - mov [esp+4], edi - mov [esp+8], esi - mov [esp+12], ebp - mov [esp+16], edx - mov edi, [eax-4] {Length(SubStr)} - mov esi, [edx-3] {Length(S)} - add ecx, edi - cmp ecx, esi - jg @@NotFound {From to High for a Match} - test edi, edi - jz @@NotFound {Length(SubStr = 0)} - lea ebp, [eax+edi] {Last Character Position in SubStr + 1} - add esi, edx {Last Character Position in S} - movzx eax, word ptr [ebp-1] {Last Character of SubStr} - add edx, ecx {Search Start Position in S for Last Character} - mov ah, al - neg edi {-Length(SubStr)} - mov ecx, eax - shl eax, 16 - or ecx, eax {All 4 Bytes = Last Character of SubStr} -@@MainLoop: - add edx, 4 - cmp edx, esi - ja @@Remainder {1 to 4 Positions Remaining} - mov eax, [edx-4] {Check Next 4 Bytes of S} - xor eax, ecx {Zero Byte at each Matching Position} - lea ebx, [eax-$01010101] - not eax - and eax, ebx - and eax, $80808080 {Set Byte to $80 at each Match Position else $00} - jz @@MainLoop {Loop Until any Match on Last Character Found} - bsf eax, eax {Find First Match Bit} - shr eax, 3 {Byte Offset of First Match (0..3)} - lea edx, [eax+edx-3] {Address of First Match on Last Character + 1} -@@Compare: - cmp edi, -4 - jle @@Large {Lenght(SubStr) >= 4} - cmp edi, -1 - je @@SetResult {Exit with Match if Lenght(SubStr) = 1} (**) - mov ax, [ebp+edi] {Last Char Matches - Compare First 2 Chars} - cmp ax, [edx+edi] - jne @@MainLoop {No Match on First 2 Characters} -@@SetResult: {Full Match} - lea eax, [edx+edi] {Calculate and Return Result} - mov ebx, [esp] - mov edi, [esp+4] - mov esi, [esp+8] - mov ebp, [esp+12] - sub eax, [esp+16] - add eax, 1 - shr eax, 1 - add esp, 20 - ret -@@NotFound: - mov edi, [esp+4] - mov esi, [esp+8] - mov ebp, [esp+12] -@@InvalidInput: - mov ebx, [esp] - add esp, 20 - xor eax, eax {Return 0} - ret -@@Remainder: {Check Last 1 to 4 Characters} - mov eax, [esi-3] {Last 4 Characters of S - May include Length Bytes} - xor eax, ecx {Zero Byte at each Matching Position} - lea ebx, [eax-$01010101] - not eax - and eax, ebx - and eax, $80808080 {Set Byte to $80 at each Match Position else $00} - jz @@NotFound {No Match Possible} - lea eax, [edx-4] {Check Valid Match Positions} - cmp cl, [eax] - lea edx, [eax+1] - je @@Compare - cmp edx, esi - ja @@NotFound - lea edx, [eax+2] - cmp cl, [eax+1] - je @@Compare - cmp edx, esi - ja @@NotFound - lea edx, [eax+3] - cmp cl, [eax+2] - je @@Compare - cmp edx, esi - ja @@NotFound - lea edx, [eax+4] - jmp @@Compare -@@Large: - mov eax, [ebp-4] {Compare Last 4 Characters of S and SubStr} - cmp eax, [edx-4] - jne @@MainLoop {No Match on Last 4 Characters} - mov ebx, edi -@@CompareLoop: {Compare Remaining Characters} - add ebx, 4 {Compare 4 Characters per Loop} - jge @@SetResult {All Characters Matched} - mov eax, [ebp+ebx-4] - cmp eax, [edx+ebx-4] - je @@CompareLoop {Match on Next 4 Characters} - jmp @@MainLoop {No Match} +begin + Result := Pos(SubStr, S, From); end; //------------------------------------------------------------------------------ @@ -1051,7 +946,10 @@ procedure abfReplaceA(var S: AnsiString; Index: Integer; procedure abfReplace(var S: string; Index: Integer; const OldStr, NewStr: string); begin - abfReplaceA(S, Index, OldStr, NewStr); + Delete(S, Index, Length(OldStr)); + Insert(NewStr, S, Index); + + //abfReplaceA(S, Index, OldStr, NewStr); end; //------------------------------------------------------------------------------ @@ -1097,8 +995,27 @@ procedure abfReplaceSubStringsExA(var S: AnsiString; procedure abfReplaceSubStringsEx(var S: string; const OldStr, NewStr: string; IgnoreCase: Boolean); +var + PosChar, Len: Integer; + SUp, OldStrUp: String; begin - abfReplaceSubStringsExA(S, OldStr, NewStr, IgnoreCase); + if not IgnoreCase then + begin + abfReplaceSubStrings(S, OldStr, NewStr); + Exit; + end; + + SUp := AnsiUpperCase(S); + OldStrUp := AnsiUpperCase(OldStr); + PosChar := 1; + Len := Length(NewStr); + repeat + PosChar := abfPosExA(OldStrUp, SUp, PosChar); + if PosChar = 0 then Break; + abfReplace(S , PosChar, OldStr, NewStr); + abfReplace(SUp, PosChar, OldStr, NewStr); + Inc(PosChar, Len); + until False; end; //------------------------------------------------------------------------------ @@ -1152,8 +1069,17 @@ procedure abfReplaceSubStringsA(var S: AnsiString; //------------------------------------------------------------------------------ procedure abfReplaceSubStrings(var S: string; const OldStr, NewStr: string); +var + PosChar, Len: Integer; begin - abfReplaceSubStringsA(S, OldStr, NewStr); + PosChar := 1; + Len := Length(NewStr); + repeat + PosChar := abfPosExA(OldStr, S, PosChar); + if PosChar = 0 then Break; + abfReplace(S, PosChar, OldStr, NewStr); + Inc(PosChar, Len); + until False; end; //------------------------------------------------------------------------------ @@ -1189,8 +1115,11 @@ procedure abfReplaceCharsA(var S: AnsiString; OldChar, NewChar: AnsiChar); //------------------------------------------------------------------------------ procedure abfReplaceChars(var S: string; OldChar, NewChar: Char); +var + i: Integer; begin - abfReplaceCharsA(S, OldChar, NewChar); + for i := 1 to Length(S) do + if S[i] = OldChar then S[i] := NewChar; end; //------------------------------------------------------------------------------ @@ -1288,7 +1217,9 @@ function abfAddCharA(const S: AnsiString; C: AnsiChar): AnsiString; function abfAddChar(const S: string; C: Char): string; begin - Result := abfAddCharA(S, C); + Result := S; + if (Length(Result) > 0) and (Result[Length(Result)] <> C) then + Result := Result + C; end; //------------------------------------------------------------------------------ @@ -1316,7 +1247,8 @@ function abfAddCharBeforeA(const S: AnsiString; C: AnsiChar): AnsiString; function abfAddCharBefore(const S: string; C: Char): string; begin - Result := abfAddCharBeforeA(S, C); + Result := S; + if (Length(Result) > 0) and (Result[1] <> C) then Result := C + Result; end; //------------------------------------------------------------------------------ @@ -1344,8 +1276,11 @@ procedure abfDeleteAfterCharExA(var S: AnsiString; C: AnsiChar; FromPos: Integer //------------------------------------------------------------------------------ procedure abfDeleteAfterCharEx(var S: string; C: Char; FromPos: Integer); +var + APos: Integer; begin - abfDeleteAfterCharExA(S, C, FromPos); + APos := abfPosExA(C, S, FromPos); + if APos > 0 then Delete(S, APos, MaxInt); end; //------------------------------------------------------------------------------ @@ -1375,8 +1310,11 @@ procedure abfDeleteBeforeCharExA(var S: AnsiString; C: AnsiChar; FromPos: Intege //------------------------------------------------------------------------------ procedure abfDeleteBeforeCharEx(var S: string; C: Char; FromPos: Integer); +var + APos: Integer; begin - abfDeleteBeforeCharExA(S, C, FromPos); + APos := abfPosEx(C, S, FromPos); + if APos > 0 then Delete(S, 1, APos); end; //------------------------------------------------------------------------------ @@ -1401,10 +1339,10 @@ procedure abfDeleteAfterCharA(var S: AnsiString; C: AnsiChar); //------------------------------------------------------------------------------ -procedure abfDeleteAfterChar(var S: string; C: Char); +{procedure abfDeleteAfterChar(var S: string; C: Char); begin - abfDeleteAfterCharA(S, C); -end; + abfDeleteAfterCharW(S, C); +end;} //------------------------------------------------------------------------------ @@ -1427,7 +1365,7 @@ procedure abfDeleteBeforeCharA(var S: AnsiString; C: AnsiChar); procedure abfDeleteBeforeChar(var S: string; C: Char); begin - abfDeleteBeforeCharA(S, C); + abfDeleteBeforeChar(S, C); end; //------------------------------------------------------------------------------ @@ -1694,7 +1632,7 @@ function abfChangeParamsA(const S: AnsiString; Params: TabfAnsiStrings; function abfChangeParams(const S: string; Params: TStrings; Separator: Char): string; begin - Result := abfChangeParamsA(S, Params, Separator); + Result := abfChangeParams(S, Params, Separator); end; //------------------------------------------------------------------------------ @@ -1754,7 +1692,7 @@ function abfEncloseStringExA(const S: AnsiString; C: AnsiChar; function abfEncloseStringEx(const S: string; C: Char; AllowDoubleEnclose: Boolean): string; begin - Result := abfEncloseStringExA(S, C, AllowDoubleEnclose); + Result := abfEncloseStringEx(S, C, AllowDoubleEnclose); end; //------------------------------------------------------------------------------ @@ -1799,7 +1737,7 @@ function abfEncloseStringA(const S: AnsiString; C: AnsiChar): AnsiString; function abfEncloseString(const S: string; C: Char): string; begin - Result := abfEncloseStringA(S, C); + Result := abfEncloseString(S, C); end; //------------------------------------------------------------------------------ diff --git a/Source/Units/abfSysUtils.pas b/Source/Units/abfSysUtils.pas index 81727ed..2c54e10 100644 --- a/Source/Units/abfSysUtils.pas +++ b/Source/Units/abfSysUtils.pas @@ -827,7 +827,7 @@ function abfGetLongPathNameW(const AShortPathName: WideString): WideString; // Retrieves the path of the system directory used by WOW64. // This directory is not present on 32-bit Windows. function abfGetSystemWow64DirectoryA: AnsiString; -function abfGetSystemWow64Directory: string; +function abfGetSystemWow64Directory: ansistring; function abfGetSystemWow64DirectoryW: WideString; //------------------------------------------------------------------------------ @@ -904,7 +904,7 @@ function abfCreateDirectoryW(const ADirName: WideString): Boolean; //------------------------------------------------------------------------------ // Adds a directory to the search path used to locate DLLs for the application. function abfSetDllDirectoryA(ADirName: PAnsiChar): Boolean; -function abfSetDllDirectory(ADirName: PChar): Boolean; +function abfSetDllDirectory(ADirName: PAnsiChar): Boolean; function abfSetDllDirectoryW(ADirName: PWideChar): Boolean; //------------------------------------------------------------------------------ @@ -1676,6 +1676,7 @@ function Min(A, B: Integer): Integer; // Raise base to an integral power. Very fast. Same as Borland's routine function IntPower(Base: Extended; Exponent: Integer): Extended; +{$IFDEF WIN32} asm mov ecx, eax cdq @@ -1697,6 +1698,12 @@ function IntPower(Base: Extended; Exponent: Integer): Extended; fdivrp { Result := 1 / Result } @@3: fwait +{$ENDIF} +{$IFDEF WIN64} +begin + +//end; +{$ENDIF} end; //------------------------------------------------------------------------------ @@ -1851,6 +1858,7 @@ function abfSafeLoadLibraryA(const AFileName: AnsiString; begin OldMode := SetErrorMode(AErrorMode); try + {$IFDEF WIN32} asm FNSTCW FPUControlWord end; @@ -1862,6 +1870,12 @@ function abfSafeLoadLibraryA(const AFileName: AnsiString; FLDCW FPUControlWord end; end; + {$ELSE} + try + Result := abfLoadLibraryA(AFilename); + finally + end; + {$ENDIF} finally SetErrorMode(OldMode); end; @@ -1885,6 +1899,7 @@ function abfSafeLoadLibraryW(const AFileName: WideString; begin OldMode := SetErrorMode(AErrorMode); try + {$IFDEF WIN32} asm FNSTCW FPUControlWord end; @@ -1896,6 +1911,13 @@ function abfSafeLoadLibraryW(const AFileName: WideString; FLDCW FPUControlWord end; end; + {$ENDIF} + {$IFDEF WIN64} + try + Result := abfLoadLibraryW(AFilename); + finally + end; + {$ENDIF} finally SetErrorMode(OldMode); end; @@ -2964,32 +2986,32 @@ function abfStrToDate(S, Format: string): TDateTime; SaveFormat: string; begin // Fix separators - abfReplaceChars(S, '/', DateSeparator); - abfReplaceChars(S, '\', DateSeparator); - abfReplaceChars(S, ' ', DateSeparator); - abfReplaceChars(S, ':', DateSeparator); - abfReplaceChars(S, '-', DateSeparator); + abfReplaceChars(S, '/', {$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator); + abfReplaceChars(S, '\', {$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator); + abfReplaceChars(S, ' ', {$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator); + abfReplaceChars(S, ':', {$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator); + abfReplaceChars(S, '-', {$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator); // Fix the case when there is no separator in format i := Length(Format); - if (Pos(DateSeparator, Format) < 1) and (Pos(DateSeparator, S) < 1) then + if (Pos({$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator, Format) < 1) and (Pos({$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator, S) < 1) then while i > 1 do begin if Format[i] <> Format[i - 1] then begin - Insert(DateSeparator, Format, i); - Insert(DateSeparator, S, i); + Insert({$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator, Format, i); + Insert({$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator, S, i); end; Dec(i); end; // Temporary change format and convert - SaveFormat := ShortDateFormat; + SaveFormat := {$IFDEF DFMT}FormatSettings.{$ENDIF}ShortDateFormat; try - ShortDateFormat := Format; + {$IFDEF DFMT}FormatSettings.{$ENDIF}ShortDateFormat := Format; Result := StrToDate(S); finally - ShortDateFormat := SaveFormat; + {$IFDEF DFMT}FormatSettings.{$ENDIF}ShortDateFormat := SaveFormat; end; end; @@ -3002,32 +3024,32 @@ function abfStrToTime(S, Format: string): TDateTime; SaveFormat: string; begin // Fix separators - abfReplaceChars(S, '/', TimeSeparator); - abfReplaceChars(S, '\', TimeSeparator); - abfReplaceChars(S, ' ', TimeSeparator); - abfReplaceChars(S, ':', TimeSeparator); - abfReplaceChars(S, '-', TimeSeparator); + abfReplaceChars(S, '/', {$IFDEF DFMT}FormatSettings.{$ENDIF}TimeSeparator); + abfReplaceChars(S, '\', {$IFDEF DFMT}FormatSettings.{$ENDIF}TimeSeparator); + abfReplaceChars(S, ' ', {$IFDEF DFMT}FormatSettings.{$ENDIF}TimeSeparator); + abfReplaceChars(S, ':', {$IFDEF DFMT}FormatSettings.{$ENDIF}TimeSeparator); + abfReplaceChars(S, '-', {$IFDEF DFMT}FormatSettings.{$ENDIF}TimeSeparator); // Fix the case when there is no separator in format i := Length(Format); - if (Pos(TimeSeparator, Format) < 1) and (Pos(DateSeparator, S) < 1) then + if (Pos({$IFDEF DFMT}FormatSettings.{$ENDIF}TimeSeparator, Format) < 1) and (Pos({$IFDEF DFMT}FormatSettings.{$ENDIF}DateSeparator, S) < 1) then while i > 1 do begin if Format[i] <> Format[i - 1] then begin - Insert(TimeSeparator, Format, i); - Insert(TimeSeparator, S, i); + Insert({$IFDEF DFMT}FormatSettings.{$ENDIF}TimeSeparator, Format, i); + Insert({$IFDEF DFMT}FormatSettings.{$ENDIF}TimeSeparator, S, i); end; Dec(i); end; // Temporary change format and convert - SaveFormat := ShortTimeFormat; + SaveFormat := {$IFDEF DFMT}FormatSettings.{$ENDIF}ShortTimeFormat; try - ShortTimeFormat := Format; + {$IFDEF DFMT}FormatSettings.{$ENDIF}ShortTimeFormat := Format; Result := StrToTime(S); finally - ShortTimeFormat := SaveFormat; + {$IFDEF DFMT}FormatSettings.{$ENDIF}ShortTimeFormat := SaveFormat; end; end; @@ -3155,7 +3177,9 @@ function abfHexToBytes(const AHex: AnsiString): TBytes; n := Length(AHex) div 2; SetLength(Result, n); for i := 0 to n - 1 do - HexToBin(@AHex[(i * 2) + 1], @Result[i], 1); + begin + //!!HexToBin(@AHex[(i * 2) + 1], @Result[i], 1); + end; end; //------------------------------------------------------------------------------ @@ -3700,7 +3724,7 @@ function abfGetDriveFileSystemA(ADrive: AnsiChar): TabfFileSystem; function abfGetDriveFileSystem(ADrive: Char): TabfFileSystem; begin - Result := abfGetDriveFileSystemA(ADrive); + Result := abfGetDriveFileSystem(ADrive); end; //------------------------------------------------------------------------------ @@ -3713,7 +3737,7 @@ function abfGetDriveFileSystemW( ADrive: WideChar ): TabfFileSystem; begin if not IsWinNT then begin - Result := abfGetDriveFileSystemA(Char(ADrive)); + Result := abfGetDriveFileSystem(Char(ADrive)); Exit; end; @@ -4011,8 +4035,13 @@ function abfGetDriveMaxMediaSizeA(ADrive: AnsiString): Int64; if ADrive = '' then Exit; if not (ADrive[1] in ['A'..'Z']) then Exit; +{$IFDEF D9} + hDevice := CreateFileW(PChar( '\\.\VWIN32'), 0, 0, nil, 0, + FILE_FLAG_DELETE_ON_CLOSE, 0 ); +{$ELSE} hDevice := CreateFileA(PChar( '\\.\VWIN32'), 0, 0, nil, 0, FILE_FLAG_DELETE_ON_CLOSE, 0 ); +{$ENDIF} if hDevice = INVALID_HANDLE_VALUE then Exit; try @@ -4942,7 +4971,7 @@ function abfGetBinaryTypeW(const AAppName: WideString; // Command line routines. //============================================================================== -function _GetNextParamStrA(P: PChar; var Param: AnsiString): PAnsiChar; +function _GetNextParamStrA(P: PAnsiChar; var Param: AnsiString): PAnsiChar; var i, Len: Integer; Start, S, Q: PAnsiChar; @@ -5343,7 +5372,7 @@ function abfSetDllDirectoryA(ADirName: PAnsiChar): Boolean; //------------------------------------------------------------------------------ -function abfSetDllDirectory(ADirName: PChar): Boolean; +function abfSetDllDirectory(ADirName: PAnsiChar): Boolean; begin Result := abfSetDllDirectoryA(ADirName); end; @@ -6097,7 +6126,7 @@ function abfSmartExpandRelativePathW(const RelativePath: WideString): WideString // Unicode version added 07/09/2007 function abfExpandRelativeFileNameExA(const BasePath, - RelativeFileName: AnsiString): string; + RelativeFileName: AnsiString): ansistring; var TempFileName: AnsiString; begin @@ -7340,7 +7369,7 @@ function _FindMatchingFileA(var F: TabfSearchRecA): Integer; with F do begin while FindData.dwFileAttributes and ExcludeAttr <> 0 do - if not FindNextFile(FindHandle, FindData) then + if not FindNextFileA(FindHandle, FindData) then begin Result := GetLastError; Exit; @@ -8764,7 +8793,12 @@ function abfLoadStringEx(AInstance: HMODULE; AID: DWORD; //now walk the string table for i := 0 to TempID - 1 do +{$IFDEF WIN32} Inc(DWORD(TablePos), SizeOf(TablePos^[0]) * (TablePos^[0] + 1)); +{$ENDIF} +{$IFDEF WIN64} + Inc(NativeInt(TablePos), SizeOf(TablePos^[0]) * (TablePos^[0] + 1)); +{$ENDIF} SetLength(Result, TablePos^[0]); Move(TablePos^[1], Result[1], SizeOf(TablePos^[0]) * TablePos^[0]); diff --git a/Source/Units/abfTypInfo.pas b/Source/Units/abfTypInfo.pas index 18afb57..80b5e3a 100644 --- a/Source/Units/abfTypInfo.pas +++ b/Source/Units/abfTypInfo.pas @@ -996,10 +996,22 @@ function abfFixComplexPropertyName(const PropName: string): string; procedure abfParseComplexPropertyName(const PropName: string; var CurrPropName, NextPropName: string); +{$IFDEF D9} +var + a: widestring; +{$ELSE} + a: string; +{$ENDIF} begin CurrPropName := abfFixComplexPropertyName(PropName); NextPropName := CurrPropName; - abfDeleteAfterChar(CurrPropName, '.'); +{$IFDEF D9} + a := CurrPropName; + abfDeleteAfterCharW(a, '.'); + CurrPropName := a; +{$ELSE} + abfDeleteAfterCharA(CurrPropName, '.'); +{$ENDIF} Delete(NextPropName, 1, Length(CurrPropName)); NextPropName := abfFixComplexPropertyName(NextPropName); end; diff --git a/Source/Units/abfVclUtils.pas b/Source/Units/abfVclUtils.pas index 74fcc5c..d6b9d4c 100644 --- a/Source/Units/abfVclUtils.pas +++ b/Source/Units/abfVclUtils.pas @@ -432,7 +432,7 @@ function abfRunShortcutWizard(const DirName: string): Boolean; Result := False; S := abfRemoveSlash(DirName); if not abfDirectoryExists(S) then Exit; - Result := WinExec(PChar('rundll32 appwiz.cpl,NewLinkHere ' + S + '\'), + Result := WinExec(PAnsiChar('rundll32 appwiz.cpl,NewLinkHere ' + S + '\'), SW_SHOWNORMAL) > 31; end; diff --git a/Source/Units/abfWAB.pas b/Source/Units/abfWAB.pas index 619573e..2d1eb3c 100644 --- a/Source/Units/abfWAB.pas +++ b/Source/Units/abfWAB.pas @@ -1019,7 +1019,7 @@ procedure abfUnloadAllWabDll; if _TWABFileObject(Items[i]).FileName <> '' then begin if not IsWinNT then - Windows.DeleteFileA(PChar(string(_TWABFileObject(Items[i]).FileName))) + Windows.DeleteFileA(PAnsiChar(string(_TWABFileObject(Items[i]).FileName))) else Windows.DeleteFileW(PWideChar(WideString(_TWABFileObject(Items[i]).FileName))); end; @@ -1048,7 +1048,7 @@ procedure abfUnloadWabDll(Handle: THandle); if _TWABFileObject(Items[i]).FileName <> '' then begin if not IsWinNT then - Windows.DeleteFileA(PChar(string(_TWABFileObject(Items[i]).FileName))) + Windows.DeleteFileA(PAnsiChar(string(_TWABFileObject(Items[i]).FileName))) else Windows.DeleteFileW(PWideChar(WideString(_TWABFileObject(Items[i]).FileName))); end; @@ -1263,7 +1263,11 @@ procedure TabfWABItem.SetDisplayName(const Value: string); if FDisplayName <> Value then begin PropsValues[0].ulPropTag := PR_DISPLAY_NAME; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FDisplayName := Value; @@ -1931,7 +1935,7 @@ procedure TabfWABContactItem.SetNamePrefix(const Value: string); if FNamePrefix <> Value then begin PropsValues[0].ulPropTag := PR_DISPLAY_NAME_PREFIX; - PropsValues[0].Value.lpszA := PChar(Value); + PropsValues[0].Value.lpszW := PWideChar(Value); if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FNamePrefix := Value; @@ -1949,7 +1953,7 @@ procedure TabfWABContactItem.SetGivenName(const Value: string); if FGivenName <> Value then begin PropsValues[0].ulPropTag := PR_GIVEN_NAME; - PropsValues[0].Value.lpszA := PChar(Value); + PropsValues[0].Value.lpszW := PWideChar(Value); if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FGivenName := Value; @@ -1967,7 +1971,7 @@ procedure TabfWABContactItem.SetMiddleName(const Value: string); if FMiddleName <> Value then begin PropsValues[0].ulPropTag := PR_MIDDLE_NAME; - PropsValues[0].Value.lpszA := PChar(Value); + PropsValues[0].Value.lpszW := PWideChar(Value); if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FMiddleName := Value; @@ -1985,7 +1989,7 @@ procedure TabfWABContactItem.SetSurname(const Value: string); if FSurname <> Value then begin PropsValues[0].ulPropTag := PR_SURNAME; - PropsValues[0].Value.lpszA := PChar(Value); + PropsValues[0].Value.lpszW := PWideChar(Value); if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FSurname := Value; @@ -2021,7 +2025,11 @@ procedure TabfWABContactItem.SetNickname(const Value: string); if FNickname <> Value then begin PropsValues[0].ulPropTag := PR_NICKNAME; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FNickname := Value; @@ -2202,10 +2210,14 @@ procedure TabfWABContactItem.SetEmailAddresses(Value: TStrings); TempAddrTypes[i] := PChar(FAddrTypes[i]); PropsValues[0].ulPropTag := PR_ADDRTYPE; - PropsValues[0].Value.lpszA := PChar(TempDefaultAddrType); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(TempDefaultAddrType); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(TempDefaultAddrType); +{$ENDIF} PropsValues[1].ulPropTag := PR_EMAIL_ADDRESS; - PropsValues[1].Value.lpszA := PChar(TempDefaultEmail); + PropsValues[1].Value.lpszA := PAnsiChar(TempDefaultEmail); PropsValues[2].ulPropTag := PR_CONTACT_ADDRTYPES; PropsValues[2].Value.MVszA.cValues := FAddrTypes.Count; @@ -2244,7 +2256,7 @@ procedure TabfWABContactItem.SetSpouseName(const Value: string); if FSpouseName <> Value then begin PropsValues[0].ulPropTag := PR_SPOUSE_NAME; - PropsValues[0].Value.lpszA := PChar(Value); + PropsValues[0].Value.lpszA := PAnsiChar(Value); if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FSpouseName := Value; @@ -2292,7 +2304,11 @@ procedure TabfWABContactItem.SetPersonalHomePage(const Value: string); if FPersonalHomePage <> Value then begin PropsValues[0].ulPropTag := PR_PERSONAL_HOME_PAGE; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FPersonalHomePage := Value; @@ -2310,7 +2326,11 @@ procedure TabfWABContactItem.SetHomeTelephoneNumber(const Value: string); if FHomeTelephoneNumber <> Value then begin PropsValues[0].ulPropTag := PR_HOME_TELEPHONE_NUMBER; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FHomeTelephoneNumber := Value; @@ -2328,7 +2348,11 @@ procedure TabfWABContactItem.SetMobileTelephoneNumber(const Value: string); if FMobileTelephoneNumber <> Value then begin PropsValues[0].ulPropTag := PR_MOBILE_TELEPHONE_NUMBER; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FMobileTelephoneNumber := Value; @@ -2346,7 +2370,11 @@ procedure TabfWABContactItem.SetPagerTelephoneNumber(const Value: string); if FPagerTelephoneNumber <> Value then begin PropsValues[0].ulPropTag := PR_PAGER_TELEPHONE_NUMBER; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FPagerTelephoneNumber := Value; @@ -2364,7 +2392,11 @@ procedure TabfWABContactItem.SetHomeFaxNumber(const Value: string); if FHomeFaxNumber <> Value then begin PropsValues[0].ulPropTag := PR_HOME_FAX_NUMBER; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FHomeFaxNumber := Value; @@ -2382,7 +2414,11 @@ procedure TabfWABContactItem.SetHomeAddressCity(const Value: string); if FHomeAddressCity <> Value then begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_CITY; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FHomeAddressCity := Value; @@ -2400,7 +2436,11 @@ procedure TabfWABContactItem.SetHomeAddressCountry(const Value: string); if FHomeAddressCountry <> Value then begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_COUNTRY; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FHomeAddressCountry := Value; @@ -2418,7 +2458,11 @@ procedure TabfWABContactItem.SetHomeAddressPostalCode(const Value: string); if FHomeAddressPostalCode <> Value then begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_POSTAL_CODE; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FHomeAddressPostalCode := Value; @@ -2436,7 +2480,11 @@ procedure TabfWABContactItem.SetHomeAddressStateOrProvince(const Value: string); if FHomeAddressStateOrProvince <> Value then begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_STATE_OR_PROVINCE; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FHomeAddressStateOrProvince := Value; @@ -2452,7 +2500,11 @@ procedure TabfWABContactItem.SetHomeAddressStreet(Value: TStrings); PropsValues: TSPropsArray; begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_STREET; - PropsValues[0].Value.lpszA := PChar(Value.Text); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value.Text); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value.Text); +{$ENDIF} if SetPropsValues(1, PropsValues, Trim(Value.Text) = '') then begin FHomeAddressStreet.Assign(Value); @@ -2469,7 +2521,7 @@ procedure TabfWABContactItem.SetBusinessHomePage(const Value: string); if FBusinessHomePage <> Value then begin PropsValues[0].ulPropTag := PR_BUSINESS_HOME_PAGE; - PropsValues[0].Value.lpszA := PChar(Value); + PropsValues[0].Value.lpszA := PAnsiChar(Value); if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FBusinessHomePage := Value; @@ -2487,7 +2539,11 @@ procedure TabfWABContactItem.SetCompanyName(const Value: string); if FCompanyName <> Value then begin PropsValues[0].ulPropTag := PR_COMPANY_NAME; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FCompanyName := Value; @@ -2505,7 +2561,11 @@ procedure TabfWABContactItem.SetTitle(const Value: string); if FTitle <> Value then begin PropsValues[0].ulPropTag := PR_TITLE; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FTitle := Value; @@ -2523,7 +2583,11 @@ procedure TabfWABContactItem.SetDepartmentName(const Value: string); if FDepartmentName <> Value then begin PropsValues[0].ulPropTag := PR_DEPARTMENT_NAME; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FDepartmentName := Value; @@ -2541,7 +2605,11 @@ procedure TabfWABContactItem.SetOfficeLocation(const Value: string); if FOfficeLocation <> Value then begin PropsValues[0].ulPropTag := PR_OFFICE_LOCATION; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FOfficeLocation := Value; @@ -2559,7 +2627,11 @@ procedure TabfWABContactItem.SetBusinessTelephoneNumber(const Value: string); if FBusinessTelephoneNumber <> Value then begin PropsValues[0].ulPropTag := PR_BUSINESS_TELEPHONE_NUMBER; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FBusinessTelephoneNumber := Value; @@ -2577,7 +2649,11 @@ procedure TabfWABContactItem.SetBusinessFaxNumber(const Value: string); if FBusinessFaxNumber <> Value then begin PropsValues[0].ulPropTag := PR_BUSINESS_FAX_NUMBER; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FBusinessFaxNumber := Value; @@ -2595,7 +2671,11 @@ procedure TabfWABContactItem.SetBusinessAddressCity(const Value: string); if FBusinessAddressCity <> Value then begin PropsValues[0].ulPropTag := PR_BUSINESS_ADDRESS_CITY; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FBusinessAddressCity := Value; @@ -2613,7 +2693,11 @@ procedure TabfWABContactItem.SetBusinessAddressCountry(const Value: string); if FBusinessAddressCountry <> Value then begin PropsValues[0].ulPropTag := PR_BUSINESS_ADDRESS_COUNTRY; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FBusinessAddressCountry := Value; @@ -2631,7 +2715,11 @@ procedure TabfWABContactItem.SetBusinessAddressPostalCode(const Value: string); if FBusinessAddressPostalCode <> Value then begin PropsValues[0].ulPropTag := PR_BUSINESS_ADDRESS_POSTAL_CODE; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FBusinessAddressPostalCode := Value; @@ -2649,7 +2737,11 @@ procedure TabfWABContactItem.SetBusinessAddressStateOrProvince(const Value: stri if FBusinessAddressStateOrProvince <> Value then begin PropsValues[0].ulPropTag := PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FBusinessAddressStateOrProvince := Value; @@ -2665,7 +2757,11 @@ procedure TabfWABContactItem.SetBusinessAddressStreet(Value: TStrings); PropsValues: TSPropsArray; begin PropsValues[0].ulPropTag := PR_BUSINESS_ADDRESS_STREET; - PropsValues[0].Value.lpszA := PChar(Value.Text); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Trim(Value.Text) = '') then begin FBusinessAddressStreet.Assign(Value); @@ -2680,7 +2776,11 @@ procedure TabfWABContactItem.SetComment(Value: TStrings); PropsValues: TSPropsArray; begin PropsValues[0].ulPropTag := PR_COMMENT; - PropsValues[0].Value.lpszA := PChar(Value.Text); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value.Text); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value.Text); +{$ENDIF} if SetPropsValues(1, PropsValues, Trim(Value.Text) = '') then begin FComment.Assign(Value); @@ -2717,7 +2817,11 @@ procedure TabfWABContactItem.SetIPPhone(const Value: string); PropsValues[0].ulPropTag := PR_IP_PHONE; if WAB.FWABSharedMode then PropsValues[0].ulPropTag := PropsValues[0].ulPropTag or $30000000; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FIPPhone := Value; @@ -3046,7 +3150,11 @@ procedure TabfWABGroupItem.DoInitDisplayName; PropsValues: TSPropsArray; begin PropsValues[0].ulPropTag := PR_DISPLAY_NAME; - PropsValues[0].Value.lpszA := PChar(FDisplayName); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(FDisplayName); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(FDisplayName); +{$ENDIF} if CheckIDistList then FDistList.SetProps(1, @PropsValues, nil); end; @@ -3470,7 +3578,11 @@ procedure TabfWABGroupItem.SetHomePage(const Value: string); if FHomePage <> Value then begin PropsValues[0].ulPropTag := PR_PERSONAL_HOME_PAGE; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FHomePage := Value; @@ -3488,7 +3600,11 @@ procedure TabfWABGroupItem.SetTelephoneNumber(const Value: string); if FTelephoneNumber <> Value then begin PropsValues[0].ulPropTag := PR_HOME_TELEPHONE_NUMBER; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FTelephoneNumber := Value; @@ -3506,7 +3622,11 @@ procedure TabfWABGroupItem.SetFaxNumber(const Value: string); if FFaxNumber <> Value then begin PropsValues[0].ulPropTag := PR_HOME_FAX_NUMBER; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FFaxNumber := Value; @@ -3524,7 +3644,11 @@ procedure TabfWABGroupItem.SetCity(const Value: string); if FCity <> Value then begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_CITY; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FCity := Value; @@ -3542,7 +3666,11 @@ procedure TabfWABGroupItem.SetCountry(const Value: string); if FCountry <> Value then begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_COUNTRY; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FCountry := Value; @@ -3560,7 +3688,11 @@ procedure TabfWABGroupItem.SetPostalCode(const Value: string); if FPostalCode <> Value then begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_POSTAL_CODE; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FPostalCode := Value; @@ -3578,7 +3710,11 @@ procedure TabfWABGroupItem.SetStateOrProvince(const Value: string); if FStateOrProvince <> Value then begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_STATE_OR_PROVINCE; - PropsValues[0].Value.lpszA := PChar(Value); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value); +{$ENDIF} if SetPropsValues(1, PropsValues, Length(Value) = 0) then begin FStateOrProvince := Value; @@ -3594,7 +3730,11 @@ procedure TabfWABGroupItem.SetStreet(Value: TStrings); PropsValues: TSPropsArray; begin PropsValues[0].ulPropTag := PR_HOME_ADDRESS_STREET; - PropsValues[0].Value.lpszA := PChar(Value.Text); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value.Text); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value.Text); +{$ENDIF} if SetPropsValues(1, PropsValues, Trim(Value.Text) = '') then begin FStreet.Assign(Value); @@ -3609,7 +3749,11 @@ procedure TabfWABGroupItem.SetComment(Value: TStrings); PropsValues: TSPropsArray; begin PropsValues[0].ulPropTag := PR_COMMENT; - PropsValues[0].Value.lpszA := PChar(Value.Text); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(Value.Text); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(Value.Text); +{$ENDIF} if SetPropsValues(1, PropsValues, Trim(Value.Text) = '') then begin FComment.Assign(Value); @@ -3822,7 +3966,11 @@ procedure TabfWABFolderItem.DoInitDisplayName; PropsValues: TSPropsArray; begin PropsValues[0].ulPropTag := PR_DISPLAY_NAME; - PropsValues[0].Value.lpszA := PChar(FDisplayName); +{$IFDEF UNICODE} + PropsValues[0].Value.lpszW := PWideChar(FDisplayName); +{$ELSE} + PropsValues[0].Value.lpszA := PAnsiChar(FDisplayName); +{$ENDIF} if CheckIABContainer then FABContainer.SetProps(1, @PropsValues, nil); end; @@ -5343,7 +5491,7 @@ procedure TabfWAB.Open; WP.hwnd := Application.Handle; if (FWABMode = wmWABFile) then - WP.szFileName := PChar(FFileName) + WP.szFileName := PAnsiChar(AnsiString(FFileName)) else if FEnableProfiles and (not FWABSharedMode) then WP.ulFlags := WAB_ENABLE_PROFILES; diff --git a/Source/abf.inc b/Source/abf.inc index bc010d2..975a224 100644 --- a/Source/abf.inc +++ b/Source/abf.inc @@ -166,6 +166,7 @@ {$IfDef VER180} {$IfDef VER185} // Delphi 11 / C++Builder 11 {$IfDef BCB} + {$Define D9} {$Define C11} {$Define C11_ONLY} {$Define Builder} @@ -176,6 +177,7 @@ {$EndIf BCB} {$Else VER185} // Delphi 10 / C++Builder 10 {$IfDef BCB} + {$Define D9} {$Define C10} {$Define C10_ONLY} {$Define Builder} @@ -189,6 +191,352 @@ {$UnDef Unknown_Compiler} {$EndIf} +{$IfDef VER190} + {$IfDef BCB} + {$Define C9} + {$Define C11} + {$Define C11_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D11} + {$Define D11_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER200} + {$IfDef BCB} + {$Define D9} + {$Define C12} + {$Define C12_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D12} + {$Define D12_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER210} + {$IfDef BCB} + {$Define C13} + {$Define C13_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D12} + {$Define D12_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER220} + {$IfDef BCB} + {$Define C13} + {$Define C13_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D13} + {$Define D13_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER230} + {$IfDef BCB} + {$Define C14} + {$Define C14_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D14} + {$Define D14_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER230} + {$IfDef BCB} + {$Define C14} + {$Define C14_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D14} + {$Define D14_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER240} + {$IfDef BCB} + {$Define C14} + {$Define C14_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D14} + {$Define D14_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER250} + {$IfDef BCB} + {$Define C15} + {$Define C15_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D15} + {$Define D15_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER260} + {$IfDef BCB} + {$Define C17} + {$Define C17_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D17} + {$Define D17_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER270} + {$IfDef BCB} + {$Define C18} + {$Define C18_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D19} + {$Define D19_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER280} + {$IfDef BCB} + {$Define C20} + {$Define C20_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D20} + {$Define D20_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER290} + {$IfDef BCB} + {$Define C9} + {$Define C21} + {$Define C21_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D9} + {$Define D21} + {$Define D21_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER300} + {$IfDef BCB} + {$Define C22} + {$Define C22_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D22} + {$Define D22_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER310} + {$IfDef BCB} + {$Define C21} + {$Define C21_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D23} + {$Define D23_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} +{$IfDef VER320} + {$IfDef BCB} + {$Define C23} + {$Define C23_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$DEFINE DFMT} + {$Define D9} + {$Define D23} + {$Define D23_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} +{$IfDef VER330} + {$IfDef BCB} + {$DEFINE DFMT} + {$Define C21} + {$Define C21_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$DEFINE DFMT} + {$DEFINE DFMT} + {$Define D9} + {$Define D24} + {$Define D24_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} +{$IfDef VER340} + {$IfDef BCB} + {$DEFINE DFMT} + {$Define C25} + {$Define C25_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$DEFINE DFMT} + {$Define D9} + {$Define D25} + {$Define D25_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER350} // Delphi 11.3 + {$DEFINE DFMT} + {$IfDef BCB} + {$Define C26} + {$Define C26_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D9} + {$Define D26} + {$Define D26_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER360} + {$DEFINE DFMT} + {$IfDef BCB} + {$Define C21} + {$Define C21_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D9} + {$Define D27} + {$Define D27_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER370} + {$DEFINE DFMT} + {$IfDef BCB} + {$Define C21} + {$Define C21_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D28} + {$Define D28_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER380} + {$DEFINE DFMT} + {$IfDef BCB} + {$Define C9} + {$Define C21} + {$Define C21_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D9} + {$Define D29} + {$Define D29_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} +// Forward looking +{$IfDef VER390} + {$IfDef BCB} + {$Define C9} + {$Define C21} + {$Define C21_ONLY} + {$Define Builder} + {$ObjExportAll On} + 1/ + {$Else BCB} + {$Define D9} + {$Define D21} + {$Define D21_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + +{$IfDef VER400} + {$IfDef BCB} + {$Define C9} + {$Define C21} + {$Define C21_ONLY} + {$Define Builder} + {$ObjExportAll On} + {$Else BCB} + {$Define D9} + {$Define D21} + {$Define D21_ONLY} + {$Define Delphi} + {$EndIf BCB} + {$UnDef Unknown_Compiler} +{$EndIf} + + //------------------------------------------------------------------------------ // Definitions for an unknown compiler