mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
Author:admin
Date:2008-09-19T14:06:51.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@28 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
[[Property:title|Accessing a COM component]]
|
||||
[[Property:link_title|Accessing a COM Component]]
|
||||
[[Property:weight|2]]
|
||||
[[Property:uuid|d27be959-8f8e-a6f0-cd20-12f6ce71307f]]
|
||||
The third tutorial describes how to access a COM component. It will build a client of the <eiffel>StringManipulator</eiffel> component built in the first tutorial.
|
||||
==Step by step instructions==
|
||||
# In '''Project''', in the '''Current project''' input field, type in ''string_manipulator_client'' and press '''enter'''.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[[Property:title|Creating a new COM component]]
|
||||
[[Property:link_title|Creating a New COM Component]]
|
||||
[[Property:weight|0]]
|
||||
[[Property:uuid|f8298b7d-c1a4-c8cc-1821-066f90e7e6e0]]
|
||||
This first tutorial describes creating a COM component from a COM definition file that is either an IDL file or a Type Library. The tutorial focuses on creating an in-process (DLL) component, called <eiffel>StringManipulator</eiffel>. The component exposes one interface <eiffel>IString</eiffel> that includes the functions <eiffel>ReplaceSubstring</eiffel> and <eiffel>PruneAll</eiffel> corresponding respectively to the features <eiffel> [[ref:libraries/base/reference/string_8_chart|replace_substring]] </eiffel> and <eiffel> [[ref:libraries/base/reference/string_8_chart|prune_all]] </eiffel> of the class <eiffel> [[ref:libraries/base/reference/string_8_chart| <eiffel>STRING</eiffel> ]] </eiffel> from the EiffelBase library. <eiffel>IString</eiffel> also exposes the property <eiffel>String</eiffel> which represents the manipulated string. The property can be set or read.
|
||||
==Step by step instructions==
|
||||
# In '''Project''', in the '''Current project''' input field, type in ''string_manipulator_server'' and press '''enter'''.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|Creating a new component from an Eiffel project]]
|
||||
[[Property:weight|1]]
|
||||
[[Property:uuid|f1f6711a-989b-f182-377d-89dd827401d5]]
|
||||
The second tutorial describes creating a COM component from an Eiffel system. The tutorial example <eiffel>String</eiffel> is almost identical to <eiffel>StringManipulator</eiffel> of the previous tutorial. In the <eiffel>StringManipulator</eiffel> example the wizard starts from an IDL file and builds an Eiffel System; in contrast, the <eiffel>String</eiffel> example takes an Eiffel system and generates an IDL file and the required plumbing code to make the Eiffel project accessible to COM.
|
||||
|
||||
==Step by step instructions==
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|EiffelCOM Wizard Guided Tour]]
|
||||
[[Property:weight|-13]]
|
||||
[[Property:uuid|b0973926-aaac-0131-ae60-d1db6ecf6f38]]
|
||||
This chapter explains how to use the EiffelCOM wizard to create COM components and to access existing components. <br/>
|
||||
* [[Creating a new COM component|Creating a new COM component]] .
|
||||
* [[Creating a new component from an Eiffel project|Creating a new component from an Eiffel Project.]]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|EiffelCOM Wizard Introduction]]
|
||||
[[Property:weight|-14]]
|
||||
[[Property:uuid|b73bc137-55ce-5404-e178-d88565cb6b62]]
|
||||
The COM standard allows software components written in different languages to communicate with each other. However, building COM compliant applications requires the development of a large amount of code only dedicated to supporting the technology. The EiffelCOM wizard was designed to free Eiffel developers from having to write the plumbing code.
|
||||
|
||||
The EiffelCOM wizard is a powerful tool that enables the fast development of COM components in Eiffel and accessing COM components from Eiffel systems. It consists of a series of input fields, which ask about the component's characteristics. The wizard needs the data to produce an Eiffel system skeleton, the code to access or create a component, and the component-specific runtime libraries.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|Building a COM Component]]
|
||||
[[Property:weight|5]]
|
||||
[[Property:uuid|eb299741-4570-c2f1-011a-69da3043c6eb]]
|
||||
The EiffelCOM wizard allows for the development of both in-process (DLLs) and out-of-process (EXEs) COM components in Eiffel.
|
||||
|
||||
==Using the Generated Code==
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|Class Hierarchy]]
|
||||
[[Property:weight|2]]
|
||||
[[Property:uuid|3f78176c-179f-78a4-cf32-47ec548bbb16]]
|
||||
The generated Eiffel code reflects the architecture of the component described in the definition file. Each interface corresponds to a deferred Eiffel class that includes one deferred feature per interface function. The deferred features are implemented in heirs of the interface class. Classes inheriting from these interfaces implement either a coclass or an implemented interface (that is an interface whose instance might be used as an argument on one of the component interfaces functions).
|
||||
[[Image:interface-inheritance]]
|
||||
In a project accessing an existing component, the Eiffel classes corresponding to component coclasses inherit from the class [[ref:libraries/com/reference/ecom_queriable_chart| <eiffel>ECOM_QUERIABLE</eiffel> ]] , which is part of the EiffelCOM library. This class includes the feature <eiffel>make_from_other</eiffel> which allows initializing the component from another instance of [[ref:libraries/com/reference/ecom_interface_chart| <eiffel>ECOM_INTERFACE</eiffel> ]] .
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|Eiffel Project Processing]]
|
||||
[[Property:weight|3]]
|
||||
[[Property:uuid|d94c4060-af70-930b-5023-1c2b2d069633]]
|
||||
The EiffelCOM Wizard can be used to add a COM interface to an existing Eiffel project. The advantage of that approach is that it doesn't require any knowledge about IDL. The EiffelCOM Wizard will take care of generating the IDL from the Eiffel facade class. The generated IDL will define one coclass containing one interface that corresponds to the contract view of the facade class.
|
||||
|
||||
==Designing the Facade Class==
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|Generated Files]]
|
||||
[[Property:weight|1]]
|
||||
[[Property:uuid|808d49ba-132d-f847-2d8c-f49fe8c499b1]]
|
||||
The EiffelCOM Wizard generates code into the specified destination folder. The file hierarchy is the following:
|
||||
[[Image:folders]]
|
||||
* The '''Client''' folder includes all the files used to access a COM component. The subfolders '''Clib''' and '''Include''' contain respectively the C++ source files and header files. The subfolder '''Component''' contains the Eiffel classes corresponding to the component's coclasses. Finally the subfolder '''Interface_proxy''' contains classes wrapping interfaces that may be returned by functions of the component. These classes may be of interest for systems implementing a new COM component as well. The '''Client''' folder also contains a ECF file that can be used to precompile the generated Eiffel classes if the project consists of accessing an existing component. It is also possible to directly use the ECF file as a library in an existing project.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|How the EiffelCOM Wizard works]]
|
||||
[[Property:weight|0]]
|
||||
[[Property:uuid|2cbfb8ef-d163-fb01-ab8f-5ab156ea36fd]]
|
||||
Depending on the project settings there are between 2 and 6 major steps involved when generating the Eiffel system:
|
||||
* '''IDL Generation''': If the project consists of adding a COM interface to an existing Eiffel project, the first step accomplished by the EiffelCOM Wizard consists of generating an IDL file from the specified facade class (see [[Eiffel Project Processing|Adding a COM interface to an Eiffel project]] for additional details).
|
||||
* '''IDL Compilation''': If the project uses an IDL file (whether it was specified or the result of processing a facade class from an existing Eiffel project), the EiffelCOM Wizard then compiles it into a type library.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|EiffelCOM Wizard Reference]]
|
||||
[[Property:weight|-12]]
|
||||
[[Property:uuid|d3564eb8-ef56-4ec1-599f-430b023fa7e8]]
|
||||
The EiffelCOM Wizard allows the creation of Eiffel projects implementing or reusing COM components.
|
||||
* [[How the EiffelCOM Wizard works|How the EiffelCOM Wizard works]] describes the steps followed by the wizard when creating the Eiffel project.
|
||||
* [[Generated Files|Generated Files]] describes the list of generated files and their usage.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|Reusing a COM Component]]
|
||||
[[Property:weight|4]]
|
||||
[[Property:uuid|ae910c51-2264-4b65-2567-9dfc1873beca]]
|
||||
The wizard generates the necessary code to access the existing component. The plumbing is already done so that instantiating an Eiffel class corresponding to one of the component's coclasses automatically calls the right COM initialization APIs.
|
||||
|
||||
==Using the Generated Code==
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[[Property:title|Wizards: Command Line Options]]
|
||||
[[Property:weight|6]]
|
||||
[[Property:uuid|ca417e46-ad46-2d3f-e13e-a88366dc06b3]]
|
||||
The EiffelCOM Wizard can be used from the command line for example in batch scripts. The command line utility is <code>com_wizard.exe</code> and is located in <code>$ISE_EIFFEL\wizards\com</code>. Each command line option has both a long and a short name. The long names are all prefixed with <code>--</code> while the short names are all prefixed with <code>-</code>. Options that take an argument should have the argument directly following the option with a space or a <code>=</code> sign in between the option name and the argument as in:
|
||||
<code>
|
||||
--ace="mysystem.ecf"</code>
|
||||
|
||||
Reference in New Issue
Block a user