Conditional directive to identify C++ Builder personalities

三世轮回 提交于 2019-12-02 00:32:25

问题


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:


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}


来源:https://stackoverflow.com/questions/2627927/conditional-directive-to-identify-c-builder-personalities

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!