首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >Delphi2007 下安装ActiveX控件[通俗易懂]

Delphi2007 下安装ActiveX控件[通俗易懂]

作者头像
全栈程序员站长
发布2022-08-27 16:01:18
发布2022-08-27 16:01:18
1.1K0
举报

大家好,又见面了,我是你们的朋友全栈君。

此英文文章来自codegear官方网站,但是是讲在BDS2006 下如何安装,我在delphi 2007下用此方法,一样通过,原文如下

Description:

How to import an ActiveX control in BDS 2006?


Answer/Solution:

Here’s the procedure for importing and installing an ActiveX control in BDS 2006.

(1) Open BDS 2006 and select File | New | Package – C++Builder.

(2) Select Component | Import Component, select the appropriate kind of component, then hit Next.

(3) Click the Add button and select your .ocx, .dll, .tlb, and so forth, file. Highlight the component in the list of controls and hit Next.

(4) Set the Palette Page (this is where the component will appear in the tool palette) and pay attention to the Unit Dir Name field. The Unit Dir Name is the directory where your component’s .cpp, .h, and other files will be generated. Hit Next.

(5) Select “Add unit to PackageName.bdsproj project” and hit Finish.

(6) Bring up the Project Manager and right-click on the package (the .bpl file) and click Install. This will build, register, and install the component into the tool palette.

Some additional notes follow. These are not vital to the control importation process but will help explain what happens…

** In step #5, if you don’t want the component to be installed into the tool palette, then select “Create unit” instead. The generated files will go into the directory specified by Unit Dir Name, which is C:/Program Files/Borland/BDS/4.0/Imports by default, and can still be used in your code.

** Be sure to save your package project. The .bdsproj file is your package’s project file, and the .bpl file is the compiled package.

==========================下面是我看了以后实验的具体步骤===========================

How can I install an external ActiveX control (.OCX file) in Delphi 2007 ?

Click File > New > Package Save the Package project. Click Component > Import Component Select Import ActiveX control. Select ActiveX-control in list or click Add and browse the for file. Fill in component details, like name and palette page. Optionally set unit directory to same location as where you saved the package project. Optionally check Generate component wrappers. Select Add unit to Package and Finish. Right click on the Package in Project manager to Build and Install package.

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/146432.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年5月1,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档