Closed zedalaye closed 4 months ago
After reading this post :
https://scotthollows.com/2016/10/13/delphi-conditional-compile-vcl-firemonkey/comment-page-1/
It came out that this code works (Delphi 12.1)
{$IF DEFINED(FPC)}
{$DEFINE USING_LCL}
{$DEFINE USING_VCL_LCL}
{$ELSEIF declared(FireMonkeyVersion)}
{$DEFINE USING_FMX}
{$ELSE}
{$DEFINE USING_VCL}
{$DEFINE USING_VCL_LCL}
{$IFEND}
Edit: In fact this does not work because declared(FireMonkeyVersion)
only make sense if Fmx.Types
is required within this unit.
For now, I will stick to this version :
// Define this globally if the app is beeing compiled for FMX (Firemonkey)
{.$DEFINE USING_FMX}
//USING_VCL_LCL - using either Delphi Visual Component Library or Lazarus Component Library
//is required if using the TImage32Panel component
//and adds a few extra library features (eg copying to and from TBitmap objects)
{$IF DEFINED(FPC)}
{$DEFINE USING_LCL}
{$DEFINE USING_VCL_LCL}
{$ELSEIF not defined(USING_FMX)}
{$DEFINE USING_VCL}
{$DEFINE USING_VCL_LCL}
{$IFEND}
It seems to me the problem is how you're compiling your DLL, and not in the Image32 library. Evidently when compiling your alleged VCL DLL, the compiler is detecting either FireMonkeyVersion or FRAMEWORK_FMX.
Hello,
When I compile my DLL that requires Img32 and Img32.FMT.PNG, the PNG file format seems not registered.
It looks like it's due to the test to detect whether Firemonkey is available :
What causes
{$IF declared(FireMonkeyVersion) OR DEFINED(FRAMEWORK_FMX)}
to be true ? Maybe a require somewhere ?Thanks for your help