[delphi技术]第三方控件的安装方法

不是由BORLAND提供的组件叫第三方组件:
安装方法:
就目前常见的各种形式的组件的安装方法介绍一下。 

1 只有一个DCU文件的组件。DCU文件是编译好的单元文件,这样的组件是作者不想把源码公布。一般来说,作者必须说明此组件适合Delphi的哪种版本,如果版本不对,在安装时就会出现错误。也正是因为没有源码,给使用者带来了不便,那就是一旦Delphi版本升级,此组件就不能再使用了,当然有的作者给出了几种版本的DCU文件,用户根据需要选择使用。这样的组件的安装方法是:在Component菜单中,选择install component,在对话框 
"into existing package"页中,单击“Unit file name”后的“Browse”按扭,在打开的文件对话框中,将“文件类型”设定为*.dcu,找到要安装的DCU文件,按OK按钮返回"into existing package"页后再按OK按钮就可以安装了。注意,此时Delphi会提示dclusr40.dpk将被重建,是否继续,OK就可以了。这里是将组件安装到dclusr40.dpk包中,此包从文件名上可以看出是用户自定义组件包,先安装到这个包中吧,下面再讲有关注意事项。安装完毕会有已经将组件注册完的提示信息以及安装到哪个组件页中的信息等,到组件面板上看看,一般会出现一个新的组件页,其中有刚安装的组件。 

2、 只有PAS文件或既有PAS又有DCU文件的组件。这种组件因为有PAS文件,也就是说作者提供了源码,这就好办多了。安装的方法和上面是一样的,在文件类型中可以设定为DCU也可以设定为PAS,建议设定为PAS,这样可用你的Delphi重新编译一下,看是否会出现问题。Delphi升级后只能选择PAS文件安装,这样才能重新编译,使得组件能适应新Delphi版本。这样的组件是很值得使用的,根据心铃的经验,没有源码的组件最好不要使用,一是存在Delphi版本升级后无法使用的问题,再者当程序出现问题后用户无法调试组件来判断是否是组件中存在BUG。 

3、有dpk文件的组件包。带有dpk文件的组件包一般是有多个组件构成的,也就是说安装后会有多个组件供使用,如果只有一个组件作者一般不会制成DPK文件,使用上面的方式发布就可以了。对于这样的组件包,一般来说会有详细的安装说明文件,如上面提到的RXLIB,由于组件复杂且安装时有先后顺序,作者不提供安装说明用户根本无法正确安装。如果没有安装说明文件,那么用下面的方法安装:在File菜单下,选择”OPEN…”打开dpk文件(文件类型列表框中选*.dpk),在出现的Package窗口中,工具栏上有Install按钮,按此按钮即可进行安装。如果Install按钮处于无效状态,那么先按Compile按钮编译,一般来说编译之后Install按钮就会处于有效状态,此时再按Install按钮就可以了。 

4、 带有Bpl文件的组件包。一般来说这也是由多种组件构成的组件包,它其实是一个动态连接库文件(DLL)。对于这种组件包的安装方法是:在component菜单下选择“install packages”,然后单击Add按钮,在打开的文件对话框中找到相应的bpl文件打开返回后,再单击Ok按钮就可以了。 

5、ActiveX控件的安装。要安装这类控件,需要先用regsvr32.exe注册,然后选择Component菜单中Import ActiveX Control项。在Import ActiveX Control打开的窗口中,只有已经注册的ActiveX控件才出现在列表中,选中一个然后按Install按钮就可以安装了。如果事先没有用regsvr32.exe注册也可以按ADD按钮找到OCX文件即时注册,注册后再进行安装。 

几点说明: 

1 在拿到组件后先看是否有说明文件,一般来说在说明文件中有如何安装的指导,有些还会有组件的属性、事件、方法的使用说明,这些在使用时是非常重要的。 

2 在上面的组件(包)安装操作之前,最好将 *.bpl拷贝到你的System目录中,将 *.pas、*.dcu、*.dcr、*.dp?拷贝到Delphi的Lib目录中再进行。 

3 前面我们提到安装DCU组件时,选用的是已经存在的dclusr40.dpk,当然也可以选择安装到一个新的包中,如果选择新包,需要先取一个名字比如DEMO,事实上安装完毕后用户可以找到的是Demo.bpl,而找不到DEMO.DPK。假如你已经将一个组件安装到dclusr40.dpk中了,还想再安装一个组件,如果再安装到dclusr40.dpk中,安装后你得到提示,原来安装的那个组件已经被取消注册,你将无法使用了。这样不就成了只能安装一个组件了吗?除非你再安装到一个新的包中才可以两个组件同时使用。当然每安装一个组件生成一个新的BPL文件也未偿不可,但BPL文件就增加许多。能否在dclusr40.dpk中多安装几个组件呢?当然是可以的。方法如下:用File菜单下的OPEN打开dclusr40.dpk文件,单击ADD按钮,在打开的对话框中选择ADD UNIT页面,按Unit file name后的“Browse”按钮打开组件单元文件,OK即可,用此种方法这样可添加多个组件的单元文件,添加完毕,按一下编译按钮,然后再按Install按钮即可,如果单元文件是编译好的(DCU)可以直接按安装按钮。 

4  组件的删除。光会安装可不行,还要会删除呀。很简单,在component菜单下,选择install packages,在列表中找到安装所在的Bpl,按Remove按钮,ok!再把Bpl文件删掉就彻底了,如果不删除BPL文件,下次可以按安装BPL组件的方法再安装使用
Unofficial version Rx library for Delphi 2005/2006/2007/2009/2010/XE/XE2/XE3 DISCLAIMER: * This software is provided "as is" and is without warranty of any kind. The author(s) of this software does not warrant, guarantee or make any representations regarding the use or results of use of this software in terms of reliability, accuracy or fitness for purpose. You assume the entire risk of direct or indirect, consequential or inconsequential results from the correct or incorrect usage of this software even if the author(s) has been informed of the possibilities of such damage. Neither the author(s) nor anybody connected to this software in any way can assume any responsibility. * All rights held by the author(s) or owner(s) of units or documents. _______________________________________________________________________________ Update 1.10 1/ Update for Delphi XE3 _______________________________________________________________________________ Update 1.09 1/ Delphi package source actualization 2/ Delphi 6 conditional corections 3/ TRxFindFiles support class added 4/ Corrections for default (ENG) lang. resource _______________________________________________________________________________ Update 1.08 1/ file case name unit corrections. 2/ only one language file can be used in your applications like: a) in Rx.inc activate {$DEFINE _LNG_ONE_}. b) activate yours own language in new include RxLangDef.inc like {$DEFINE RXLANG_Cze}. note: Languages different from English locates in utf-8 files, may be editor problem for lower version Delphi than 2005. c) in your project use global conditional define like RXLANG_MYLANG (it activate your lang file only). d) rebuild your application, it will be smaller with one your language mutation for RxLibrary only. 3/ repair malfunction of TColor property (big thanks to Remy Lebeau). 4/ many new constant color names added into module RxColors (+ 229 named constant). 5/ new component TRxThread added for better access. 6/ repair malfunction of property caption editor. 7/ new components TRxAnimBitBtn, TRxAnimSpeedButton added. 8/ repair malfunction with styles in TRxProgress. 9/ refresh code in TRxDBGridSorter. 10/ adopted 20 function utilities by Alexey Popov into module RxProps. 11/ activate Align property in TRxSpinButton. 12/ rename parameter Name to AName in define event TExecOpenDialogEvent, because occur names conflict. 13/ repair conflict in string property in module RxTranslate for unicodes. 14/ some functions added into module RxVerInf for better work with versions. Note for users Delphi 5/6/7: ---------------------------- RxLibrary is not directly designed for this Delphi versions. When you will want compile source code in this versions of Delphi, you have to open all units contain form (*.dfm) and resave it for resource compatibility (crash prevent IDE) before rebuild and install into IDE. Some functionality will be lost. Note for users Delphi XE2 (64 bit.ver): --------------------------------------- This source code is 64 bit ready but untested. BDE packs must be removed from 64 bit project as unsuported technology. Note for users CBuilder: ------------------------ This source code is CBuilder (2006/2007) ready but uncomplete and untested yet. Releases February 29, 2012 _______________________________________________________________________________ Update 1.07 1/ Update all packages in unit scope. 2/ Change namespace in RxViewer unit for XE2. _______________________________________________________________________________ Update 1.06 1/ repair malfunction of TFormStorage under Unicode Delphi. 2/ update packages file for Delphi 2005 - XE. 3/ update package for Delphi XE2 32 bit. _______________________________________________________________________________ Update 1.05 1/ better compatibility with Delphi 2009. 2/ new adopted component for view any supported files. 3/ convert dfm files to text. _______________________________________________________________________________ Update 1.04 Updated: 1/ small mistake in RxDBCtrl.pas (wrong show DBGrid). 2/ activate tables in general RxDemo. 3/ replacement deprecated FileAge() in RxFileUtils. _______________________________________________________________________________ The initial release(s) no included
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值