0% found this document useful (0 votes)
216 views

Creating COM+ Applications

The document describes various procedures for managing COM+ applications and components, including creating a new COM+ application, installing and importing components, removing components, and moving or copying components between applications. It provides step-by-step instructions for each procedure.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
216 views

Creating COM+ Applications

The document describes various procedures for managing COM+ applications and components, including creating a new COM+ application, installing and importing components, removing components, and moving or copying components between applications. It provides step-by-step instructions for each procedure.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Creating COM+ Applications

This section describes how to create a new (empty) COM+ application and then add components to that application. It also describes how to add COM components to, and remove them from, existing COM+ applications, and how to move and copy components from one COM+ application to another.
Topic Description

Creating a New COM+ Application Installing New Components Importing Components Removing a Component from a COM+ Application Moving Components Copying Components Deleting a COM+ Application

Describes how to create a new COM+ application. Describes how to install new components. Describes how to import components. Describes how to delete a component from a COM+ application. Describes how to move a component from one COM+ application to another. Describes how to copy a component from one COM+ application to another. Describes how to delete a COM+ application.

For conceptual information on the procedures described in this section, see COM+ Application Overview and Deploying COM+ Applications. For procedural information on the administrative tasks involved in exporting and installing COM+ applications, see "Installing COM+ Applications" in the Component Services Administrator's Guide.
Related topics Automating COM+ Administration Configuring COM+ Applications Conversion of MTS Packages to COM+ Applications

Send comments about this topic to Microsoft Build date: 10/16/2012

Creating a New COM+ Application


Creating a new COM+ application requires two basic steps, as follows:

Creating an empty COM+ application (described below). Adding components to the application. (See Installing New Components and Importing Components.)

To create an empty COM+ application 1. In the console tree of the Component Services administrative tool, select the computer on which you want to create an application. 2. Select the COM+ Applications folder for that computer. 3. On the Action menu, point to New, and then click Application. You can also rightclick the COM+ Applications folder, point to New, and then click Application. 4. On the Welcome page of the COM+ Application Install Wizard, click Next, and then in the Install or Create a New Application dialog box, click Create an empty application. 5. In the box provided, type a name for the new application. (Note that the following special characters cannot be used in an application name: \, /, ~, !, @, #, %, ^, &, *, (, ), |, }, {, ], [, ', ", >, <, ., ?, :, and ;.) Under Activation type, click Library application or Server application. Click Next. Note A server application runs in its own process. Server applications can support all COM+ services. A library application runs in the process of the client that creates it. Library applications can use role-based security but do not support remote access or queued components. 6. In the Set Application Identity dialog box, choose an identity under which the application will run. If you select This user, type the user name and password. You must also retype the password in the Confirm password box. Click Next. (The default selection for application identity is Interactive User. The interactive user is the user logged on to the server computer at any given time. You can select a different user by selecting This user and entering a specific user or group.) Note The Set Application Identity dialog box appears only if you selected Server application for the new application's activation type in the COM Application Install Wizard's preceding dialog box. The identity property is not used for library applications. 7. In the Add Application Roles dialog box, add any roles you want to associate with the application. By default, only the CreatorOwner role is defined. For information on roles, see Role-Based Security Administration. 8. In the Add Users to Roles dialog box, populate each role you created in the last step with the users, groups, or built-in security principals to which you want to grant

the privileges associated with that role. By default, the interactive user is placed in the CreatorOwner role. 9. Click Finish. The new application will now be displayed under the COM+ Applications folder in the console tree of the Component Services administrative tool. Note As of Windows Server 2003, access checks are enabled by default when creating a COM+ application. In previous versions, access checks were disabled by default at the application level. The result is that by default, access to a COM+ application is allowed only to users that are in the roles associated with the application. (See Role-Based Security Administration.) Alternatively, you can allow access to all users by disabling access checks on a COM+ application. (See Enabling Access Checks for an Application.)

Installing New Components


To add components to the Components folder of a COM+ application, you can either use the COM+ Component Install Wizard or drag .dll files that contain the components from the Windows Explorer and drop them in the application. If you use the COM+ Component Install Wizard, you can either install a new component, which registers the component on the computer, or import components that have already been registered. Components can be added to empty applications or existing applications. To add a component to a COM+ application 1. In the console tree of the Component Services administrative tool, select the computer hosting the COM+ application. 2. Open the COM+ Applications folder for that computer, and select the application in which you want to install the component(s). 3. Open the application folder and select Components. 4. On the Action menu, point to New, and then click Component. You can also rightclick the Components folder, point to New, and then click Component. 5. On the Welcome page of the COM+ Application Install Wizard, click Next, and then in the Import or Install a Component dialog box, click Install new components . 6. In the Install new components dialog box, click Add to browse for the component you want to add. 7. In the Select files to install dialog box, type the filename of the component to install or select a filename from the displayed list. Click Open. After you add the files, the Install new components dialog box displays the files you have added and their associated components. If you select the Details check box, you will see more information about file contents and the components that were found.

Note Unconfigured COM components must have a type library. If COM+ cannot find your component's type library, your component will not appear in the list. You can also remove a file from the Files to install list by selecting it and clicking Remove. 8. Click Next, and then click Finish to install the component.

Importing Components
You can use the Component Services administrative tool to import into applications specific components that have already been registered on your computer as COM components in the Windows registry. Importing a component does not install the interface or method information required to set interface properties or to configure access to the component from a remote client. Therefore, if possible, you should install rather than import unconfigured components. Note When importing a component into a COM+ application, COM+ does not populate interface and method information for the component. During the export of an application proxy, COM+ will not provide marshaling information (type libraries or proxy/stubs) for some or all of the interfaces. Exporting application proxies that contain imported components will fail or cause a warning to be issued. To import a component into a COM+ application 1. In the console tree of the Component Services administrative tool, select the computer hosting the COM+ application. 2. Open the COM+ Applications folder for that computer, and select the application in which you want to install the component. 3. Open the application folder and select Components. 4. On the Action menu, point to New, and then click Component. You can also rightclick the Components folder, point to New, and then click Component. 5. On the Welcome page of the COM+ Application Install Wizard, click Next, and then in the Import or Install a Component dialog box, click Import component(s) that are already registered. 6. In the Choose Components to Import dialog box, select the Details check box to see complete information about the components that are already registered. Select the component(s) you want to import from the displayed list, and click Next. 7. Click Finish.

Removing a Component from a COM+ Application

You can use the Component Services administrative tool to remove components from a COM+ application. Note Exercise care when deleting and reinstalling individual components from a COM+ application. This process requires detailed knowledge about the component's classes, including their attributes, security configurations on interfaces and methods, and other settings. To remove a component from a COM+ application 1. In the console tree of the Component Services administrative tool, select the application that contains the component you want to remove. 2. Open the application's Components folder. 3. Select the component you want to remove. 4. On the Action menu, click Delete. You can also select the component, right-click, and click Delete. 5. Click Yes when prompted to confirm your action.

Moving Components
You can move a component from one COM+ application to another. In effect, moving a component removes the component from the original COM+ application and installs it in the target COM+ application. To move a component from one COM+ application to another 1. In the details pane of the Component Services administrative tool, right-click the component that you want to move and then click Move. 2. In the Move component(s) dialog box, select the destination COM+ application to which you want the component to be moved. 3. Click OK.

Copying Components
You can copy a component from one COM+ application to another. After you copy a component to another COM+ application, you can configure this component differently than the original component. To copy a component from one COM+ application to another 1. In the details pane of the Component Services administrative tool, right-click the component that you want to copy and then click Copy. 2. In the Copy Component dialog box, in the Please select a Destination pane, select the COM+ application to which the component will be copied.

3. Enter the new ProgID for the copied component. Note The ProgID for the original component is displayed for reference and cannot be changed. 4. Enter the new CLSID for the copied component. COM+ displays an automatically generated CLSID. In most cases, this will be sufficient to uniquely identify the copied component. Enter a new CLSID only if you want to change the one provided by COM+. 5. Click OK.

Deleting a COM+ Application


As existing applications become dated or are no longer being used, you may need to remove them. To delete a COM+ application 1. In the console tree of the Component Services administrative tool, select the computer for which you want to delete an application. 2. Open the COM+ Applications folder for the specified computer to display all the applications. 3. Select the application you want to remove. 4. If you selected a server application, shut down the application. You can shut down an application by selecting it in the Component Services administrative tool, rightclicking, and then clicking Shut down. If you selected a library application, make sure that all processes currently using this library application are shut down. 5. On the Action menu, click Delete. You can also right-click the application name and then click Delete. You can also delete an application by selecting it in the Component Services administrative tool and pressing the Delete key, or you can select the application, right-click, and then click Delete. 6. Click Yes when prompted to confirm your action. In addition, if a server application or application proxy has been installed on a computer using Windows Installer (as described in "Installing COM+ Applications" in the Component Services Administration Guide), you can delete it through the Add/Remove Programs utility in the Microsoft Windows Control Panel. Or you can delete an installed server application or application proxy by using the Windows Installer command line syntax: msiexec -x application_name.msi These methods are especially useful for deleting COM+ applications on client machines that are not running the Component Services administrative tool.

Deleting the application also deletes any components contained in the application. If these components depend on additional resources (database connections, data or text files, IIS virtual root configuration, and so on), these resources must be removed through mechanisms other than the Component Services administrative tool.

You might also like