我在DELPHI端做了一个OLE,添加了相关的方法 通过编译生成.COM文件, 可以通过脚本调用也可以通过DELPHI或其它程程序调用 如: VBS DIM SOAP SET SOAP=CREATEOBJECT("MSSOAP.SOAPCLIENT") WSCRIPT.ECHO SOAP.ADD(12,12) '显示相加内容 通过HIGHT API SOAP调用DELPHI的.COM文件
Last updated on 6/30/01
Building a COM Server Application by Binh LyA COM server application provides services to a COM client application. If you've previously studied the basics of COM clients and servers, we're now ready to see it in action in Delphi. The following basic steps are performed to build a COM server:Determine what kind of COM server to create. This can be an EXE server or a DLL server. Create the COM server framework/housing. Create the COM components Deploy the COM server DLL vs. EXE A DLL server normally executes in the address space of its client. As such, it is very efficient in terms of execution speed. Examples of DLL servers are windows shell extensions, plugins, ActiveX controls, and utility servers.An EXE server executes outside the address space of its client. Since an EXE server is isolated from the client application, it can be configured to run under a separate security context, implement its own threading mechanisms, and has less impact on the client in case of runtime failure. Examples of EXE servers are standalone applications that also support automation such as the Microsoft Office applications, or a COM server implemented as a Windows Service application.Although DLLs are normally executed in the address space of a client, it is possible to host a DLL server into an EXE application and thus achieve the same behavior and advantages of an EXE server. An example of such host is the MTS/COM+ runtime environment. One of main reasons to do this is to have the host provide add-on infrastructure not normally/easily available for DLL servers such as security management, thread management, process isolation, etc.In general, it is safe to assume the we want to build DLL servers unless we are building COM into an existing standalone EXE application or a Windows Service application.Note that only DLLs have the ability to be hosted into the MTS/COM+ runtime. If we build an EXE server, it cannot be hosted into the MTS/COM+ runtime down the road unless, of course, we convert it to a DLL server.
COM组件是通过接口来实现的,接口里只实现方法,不实现数据(也即你说的属性);
当然你在具体设计时要实现属性怎么办呢?
你先考虑组件方法,然后对应一个类来实现此接口,此时即可加入属性.
美女照:
http://joke.tom.com/Archive/1019/1021/2002/9/2-17408.html
var
Sen:Variant;
begin
try
Sen:=CreateOleObject("Jet.Cat");
try
Sen.Show("ok");
finally
end;
finally
end;
end;
var
sen:variant;
begin
try
sen:=createoleobject("Jet.Cat");
try
sen.Show("ok"):
finally
end;
finally
end;
end;
如果一定要使用,那可以在类型库编辑器里实现(view--->lib type顺便说一句:以前我也用女孩的名字做过类似的事,我能理解你!
通过编译生成.COM文件,
可以通过脚本调用也可以通过DELPHI或其它程程序调用
如:
VBS
DIM SOAP
SET SOAP=CREATEOBJECT("MSSOAP.SOAPCLIENT")
WSCRIPT.ECHO SOAP.ADD(12,12) '显示相加内容
通过HIGHT API SOAP调用DELPHI的.COM文件
Building a COM Server Application
by Binh LyA COM server application provides services to a COM client application. If you've previously studied the basics of COM clients and servers, we're now ready to see it in action in Delphi. The following basic steps are performed to build a COM server:Determine what kind of COM server to create. This can be an EXE server or a DLL server.
Create the COM server framework/housing.
Create the COM components
Deploy the COM server
DLL vs. EXE A DLL server normally executes in the address space of its client. As such, it is very efficient in terms of execution speed. Examples of DLL servers are windows shell extensions, plugins, ActiveX controls, and utility servers.An EXE server executes outside the address space of its client. Since an EXE server is isolated from the client application, it can be configured to run under a separate security context, implement its own threading mechanisms, and has less impact on the client in case of runtime failure. Examples of EXE servers are standalone applications that also support automation such as the Microsoft Office applications, or a COM server implemented as a Windows Service application.Although DLLs are normally executed in the address space of a client, it is possible to host a DLL server into an EXE application and thus achieve the same behavior and advantages of an EXE server. An example of such host is the MTS/COM+ runtime environment. One of main reasons to do this is to have the host provide add-on infrastructure not normally/easily available for DLL servers such as security management, thread management, process isolation, etc.In general, it is safe to assume the we want to build DLL servers unless we are building COM into an existing standalone EXE application or a Windows Service application.Note that only DLLs have the ability to be hosted into the MTS/COM+ runtime. If we build an EXE server, it cannot be hosted into the MTS/COM+ runtime down the road unless, of course, we convert it to a DLL server.
潘爱民我们从各种媒体对Windows 2000的介绍可以看到,在Windows 2000众多新的功能和特性之中,对于开发人员来说,COM+是最值得关注的一个焦点。在Windows 2000的Beta版本中,我们已经看到了COM+的面貌,也感受到了COM+将带给我们程序设计和开发过程中思路上的变化。本文旨在从技术的角度对COM+作一个基本的介绍,以便开发人员更好地了解COM+。你自己去看吧
咳...咳...
也难怪---程序员难过"挑战关---嘻嘻..我一定要搞定它..."
UP