RRUZ / vcl-styles-utils

Extend and improve the Delphi VCL Styles
https://theroadtodelphi.wordpress.com/
329 stars 115 forks source link

Undeclared identifier: 'v1compatibility' error in 10.4 #268

Open gtclewis opened 4 years ago

gtclewis commented 4 years ago

Using the following code

uses Vcl.Themes, Vcl.Styles, Vcl.Forms, {$DEFINE USESTYLEHELPER} {$IFDEF USESTYLEHELPER} Vcl.Styles.Utils.Graphics, Vcl.Styles.Utils.Menus, Vcl.Styles.Utils.Forms, Vcl.Styles.Utils.StdCtrls, Vcl.Styles.Utils.ComCtrls, Vcl.Styles.Utils.ScreenTips, Vcl.Styles.Utils.SysControls, Vcl.Styles.Utils.SysStyleHook, {$ENDIF }

I get the compiler error [dcc64 Error] Vcl.Styles.UxTheme.pas(4548): E2003 Undeclared identifier: 'v1compatibility'.

v1compatibility doesn't appear to be defined anywhere in your code and the only place it exists is in this code:

{$IF CompilerVersion >= 30}

function InterceptCreateOrdinal(const Module: string; MethodName: Integer; const InterceptProc: Pointer; ForceLoadModule: Boolean = True; Options: Byte = v1compatibility): Pointer;

var pOrgPointer: Pointer; LModule: THandle; begin Result := nil; LModule := GetModuleHandle(PChar(Module)); if (LModule = 0) and ForceLoadModule then LModule := LoadLibrary(PChar(Module));

if LModule <> 0 then begin pOrgPointer := GetProcAddress(LModule, PChar(MethodName)); if Assigned(pOrgPointer) then Result := DDetours.InterceptCreate(pOrgPointer, InterceptProc, Options); end; end; {$IFEND}

rickard67 commented 4 years ago

You should find the solution here https://github.com/RRUZ/vcl-styles-utils/issues/267

The git current version isn't compatible with the latest version of Detours.

There seems to be other issues where some commits have vanished and the latest pull request may be difficult to merge with the current version. Anyway, I have an pretty updated version which is both compatible with Detours v2.2 and works properly with the latest high DPI enabled Delphi 10.4 vcl styles. I'll try to find the time to create a temporary download location for it. Maybe RRUZ will add it to the repository eventually...

/Rickard