Jump to content
plastkort

VCL component issue

Recommended Posts

im trying to use a very old component i made for delphi 7 back in the days, i havent touched it for many years. but it installed ok without a problem,

 

however when i go to the component list and want to add it.. it seems to be "faded" and cannot be added... why is it so ?

 

it works if i create a new application and try to add it...

 

cannotuse.png

Share this post


Link to post
10 minutes ago, PeterBelow said:

Is the project perhaps Win64 or FMX?

Or perhaps no framework at all? Try placing a standard VCL control first and the IDE might ask you.

Share this post


Link to post

A notion of a change to the control design interface between D7 and modern Delphi rustles in the back of my head, but I have not done component work in ages....

Share this post


Link to post

You must include a class attribute to specify which platforms the component is going to be available:


type

  ...

  [ComponentPlatformsAttribute(pidWin32 or pidWin64 or pidOSX32 or pidiOSSimulator or pidiOSDevice32 or pidiOSDevice64 or pidAndroid)]
  TVCDProgress = class(TCustomControl)
    ...
  end;

 

  • Like 1
  • Thanks 1

Share this post


Link to post
4 hours ago, Christen Blom-Dahl said:

You must include a class attribute to specify which platforms the component is going to be available:



type

  ...

  [ComponentPlatformsAttribute(pidWin32 or pidWin64 or pidOSX32 or pidiOSSimulator or pidiOSDevice32 or pidiOSDevice64 or pidAndroid)]
  TVCDProgress = class(TCustomControl)
    ...
  end;

 

Note, there are a lot more ComponentPlatforms values available than just those shown above:

 

pidAllPlatforms (new in 10.3.2!)
pidWin32
pidWin64
pidOSX32
pidiOSSimulator32/pidiOSSimulator
pidAndroid32Arm/pidAndroid
pidLinux32
pidiOSDevice32/pidiOSDevice
pidLinux64
pidWinNX32
pidWinIoT32
pidiOSDevice64
pidWinARM32/pidWinARM
pidOSXNX64/pidOSX64
pidLinux32Arm
pidLinux64Arm
pidAndroid64Arm/pidAndroid64
pidiOSSimulator64

  • Like 2

Share this post


Link to post

A quick and dirty way of adding this component in design time is to switch the platform back to Win32, drop the component and then switch back (even completely remove the Win32 platform).

I usually have to do this with my 64bit applications using database access components.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×