哪位大侠讲讲ActiveX面板上的各项都是创建哪些内容

wintergoes 2007-04-09 10:24:09
ActiveX面板上可以创建多种关于COM的组件,但是各项创建的是什么样的组件,在什么情况下需要创建哪个组件,请大侠讲一下,谢谢
...全文
216 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wintergoes 2007-04-09
  • 打赏
  • 举报
回复
不要帮助里的东东,大家凭经验讲一下吧,知道哪个说说哪个好了。
mdejtod 2007-04-09
  • 打赏
  • 举报
回复
给你一个SHELL控件的例子:
function TDBAcc.ControlEthernet(const EthName,FolderItemVerbsName: String): Boolean;
var cpFolder,nwFolder:Folder; //外壳文件夹对象
nVerbs:FolderItemVerbs; //获得外壳文件夹对象上下文相关的菜单信息
i,j,k:integer;
Shell1:TShell;
begin
Result:=false;
Shell1:=TShell.Create(Application);
cpFolder:=Shell1.NameSpace(3); //选择控件面板
if cpFolder<>nil then
begin
for i:=0 to cpFolder.items.Count-1 do //返回它所包含的外壳对象的集合(文件夹)28
begin
if cpFolder.Items.Item(i).Name='网络和拨号连接' then
begin
nwFolder:=cpFolder.items.item(i).GetFolder as Folder; //作为文件夹
if nwFolder<>nil then
begin
for j:=0 to nwFolder.items.Count-1 do
begin
if nwFolder.Items.Item(j).Name=EthName then //若果为'本地连接'
begin
nVerbs:=nwFolder.Items.Item(j).Verbs; //取得该对象的上下文菜单信息(sFolder.Items.Item(0).verbs.Item(i).Name)
for k:=0 to nVerbs.Count-1 do
begin
if nVerbs.Item(k).Name=FolderItemVerbsName then
begin
nVerbs.Item(k).DoIt;
//nwFolder.Items.Item(j).InvokeVerb(nwFolder.Items.Item(j).Verbs.Item(k).Name);
Result:=true;
end;
end;
end;
end;
end;
end;
end;
end;
shell1.Free;
end;

调用方法:ControlEthernet('本地连接',discVerb); //禁用本地连接
const
discVerb = '停用(&B)';
connVerb = '启用(&A)';
qiume 2007-04-09
  • 打赏
  • 举报
回复
看帮助请按F1:
Click the objects on this page to create new COM objects, Active Forms, ActiveX controls, property pages for ActiveX controls, and type libraries for Active X controls or Automation objects.

New Item Description

Active Form Create a new Active form, which is a simple ActiveX control (descended from TActiveForm) preconfigured to run on a Web browser. The ActiveX Control wizard appears to guide you through the creation process, allowing you to add controls to the form. The wizard creates an ActiveX Library project (if needed), a type library, a form, an implementation unit, and a unit containing corresponding type library declarations.Note: Unlike other ActiveX controls, you cannot modify the properties of a built Active form in a development environment unless you add code to publish the properties.

Active Server Object Create an Active Server Page from an existing application. The Active Server Object dialog appears, where you can specify the CoClass name, threading model, and so on.

ActiveX Control Create a new ActiveX control. The ActiveX Control wizard guides you through the creation process, choosing the VCL object on which you want to base the new control. Note that ActiveX controls need an ActiveX library to expose their interfaces and method arguments to client applications. If an ActiveX Library project is not open before you try to create an ActiveX control, the product opens one.

ActiveX Library Create a new ActiveX library. A template file named Project1.dpr is created as a starting point for you. If an ActiveX Library project is not open before you try to create an ActiveX control, the product opens one.
Automation Object Create a new Automation object. The Automation Object wizard allows you to enter a class name for the new Automation object, and set the threading model. Once the wizard creates the Automation object, use the Type Library editor to define the interface it exposes to clients.

COM Object Create a new COM object to implement a registered interface or a new interface that descends from IUnknown. The COM Object wizard allows you to specify the properties of a new COM server.

COM+ Event Object Create a new COM+ event object to dispatch server events to all registered clients. The COM+ Event Object wizard adds a COM+ event object to an existing event object project or starts a new event object project for the object. After the wizard generates the event object, use the Type Library editor to define its interface.

COM+ Subscription Object Create a COM+ event subscriber component using the COM+ Subscription Object wizard. You use this with a COM+ Event Object to receive notification of events fired by COM+ publisher applications.

Property Page Create a file that sets up an ActiveX property page. The property page appears in design mode, ready for you to add private and public declarations. You can design a dialog box in the form window, grouping properties to make it easy for developers to modify the control when implementing it in an application.

Transactional Object Create a new Automation object that takes advantage of the distributed application services supplied by MTS or COM+. The Transactional object wizard lets you specify the desired transaction model. After the wizard exits, use the Type Library editor to define the interface the object exposes to clients. If the object is to be installed under COM+, use the COM+ page of the Type Library editor to specify the options to use when installing it into a COM+ application.

Type Library Create or edit a library of type information that can be used by other type libraries or that defines interfaces that the COM object wizard uses to generate objects. The Type Library editor appears.
xiaocai800322 2007-04-09
  • 打赏
  • 举报
回复
关注
wintergoes 2007-04-09
  • 打赏
  • 举报
回复
《深入核心VCL架构剖析》

7-1-6设计的想法
也许许多程序员撰写COM多年却从没有想过COM的对象有多少种类,其实我们可以把COM对象粗分为下几种:
1、支持IUnknown接口的最基础COM对象:适合作为基础根对象类
2、拥有TypeLibrary信息的COM对象
3、拥有TypeLibrary并且支持IDispatch和Dual Interface的COM对象,提供脚本语言使用
4、支持IDispatch的COM对象
5、支持其他COM接口的COM对象。
如果我们再仔细地思考这些不同种类的COM对象,那么便可以发现这些不同的COM对象只是支持的COM接口不同,许多的特性却非常的相似。因此如果我们已经有了一个TComObject类:
TComObject = Class(TObject, IUnknown)
那么支持Type Library的COM对象可以定义如下:
TTypedComObject = Class(TComObject, IProvideClassInfo)
因为IProvideClassInfo接口可允许客户端存取COM组件之中的Type Information,如此一来TTypeComObject便可作为其它拥有Type Information对象的你类。一旦提供了TTypedComObject类之后,客户端就可以存取COM组件包含的Type Information。

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧