识别C ++ Builder个性的条件指令 [英] Conditional directive to identify C++ Builder personalities

查看:133
本文介绍了识别C ++ Builder个性的条件指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Delphi组件,我想安装,并在Delphi中的组件调色板中可用,但不在C ++ Builder中。在BDS / RAD 2006及以上版本中,我可以将其安装为两个人物,也可以不安装。



我需要这样做,因为这个组件使用的第三方库支持C ++ Builder。



我看过 jedi.inc 提到这里,但是我无法找到组合,只能在Delphi个性中注册组件。该组件也适用于较旧的Delphi版本:D5,D6和D7;但不适用于BCB5和BCB6。这是可能吗?



BTW:组件是用Delphi编写的。 C ++ Builder与Delphi共享相同的包。



提前感谢

解决方案

p> BCB定义仅在Delphi正在编译时支持C ++ Builder(使用-J开关)才能设置。您可以使用这样的代码来检测有人正在使用C ++支持来构建包,并发出错误

  {$ IFDEF BCB} 
{$消息错误'该组件在C ++ Builder中不可用}
{$ ENDIF BCB}


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.

解决方案

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}

这篇关于识别C ++ Builder个性的条件指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆