Conditional directive to identify C++ Builder pers

2019-02-24 23:30发布

I have a Delphi component which I want to install and have it available at the component palette in Delphi but not in C++ Builder. In BDS/RAD 2006 and above I can either have it installed for both personalities or none.

I need to do so because this component uses 3rd party libraries that doesn't support C++ Builder.

I have looked at jedi.inc mentioned here but I'm not able to find the combination to be able to register the component in Delphi personalities only. The component should also work for older Delphi versions: D5, D6 and D7; but not for BCB5 and BCB6. Is this possible?

BTW: Component is written in Delphi. C++ Builder shares same packages as Delphi.

Thanks in advance.

1条回答
Ridiculous、
2楼-- · 2019-02-25 00:20

the BCB define is only set when Delphi is compiling with support for C++Builder (using the -J switches) You can use code like this to detect that someone is trying to build your package with C++ support and issue an error

{$IFDEF BCB}
{$Message Error 'This component is not usable in C++Builder'}
{$ENDIF BCB}
查看更多
登录 后发表回答