Transplanted to Windows 2000 and COM +

zhaozj2021-02-17  46

Transplanted to Windows 2000 and COM

After the Windows 2000 CD, the next step is to learn how to start using COM . You may need to keep interoperability with some developer computers, or may have to upgrade the server and want to know how to do it.

The goal of this section is to help you convert the server and development environment to Windows 2000. Compared with previous technologies, COM has great improvements, so transplant is worth it. Please read this section completely and develop a transplant plan for you and your team.

Consider installing Windows 2000 from scratch

When you install Windows 2000, you can choose to install the system or upgrade the current configuration from a zero. If it is the latter, the Windows 2000 installer actually transplays the old configuration to a new installation, including converting the MTS package to a COM application. It is best to install Windows 2000 in a clean system and manually recreate the package. This prevents defects in the old configuration to further spread.

why

According to the experience in the upgrade, we believe that the time saved (because the server is not reconfigled) is not worthless, because it is not guaranteed to bring any errors (corrupt or unclean registration, blocking directory, etc.) surroundings.

Of course there is exception. Depending on the role of the machine, you can decide to keep the status (for example, an upgrade the primary domain controller) during the upgrade process. However, the application server usually does not retain many native status, so "new installation" can be performed well.

details

When planning to upgrade, you should usually read the Windows 2000 Planning and Design Guide in Windows 2000 Server Resources. The Deployment Guide lists the support upgrade paths for Windows 2000 Professional, Windows 2000 Server, and Windows 2000 Advanced Server, and illustrates other factors that may be upgraded, rather than performing clean-installed decisions. (Remember, the term "upgrade" means replacing the operating system with the upgrade function of Windows 2000. Clean installation representative first format disk, reinstall the operating system and all applications). Then discuss tools and steps that automate automation of the operating system upgrade process.

reference

Windows 2000 Server Resources Daquan (English) Deployment Plan Guide (English) Remote OS Installation Steps (English) Upgrade MSMQ 1.0 Enterprise Edition to "Message Queue Deployment" in the Windows 2000 domain (English can be from FTP: //ftp.microsoft.com/bussys/distapps/msmq/win2000/migration/migration3.doc download.)

Create a new package and verify all properties

If Windows 2000 is installed from zero, the MTS package will not be ported to the COM application. There are two options to transplant the MTS package into the COM application:

If the MTS package has a PAK file, you can install the PAK file of the MTS package in Windows 2000, convert the MTS application to a COM application. However, converting the MTS application to COM applications may generate more errors, and carry too much information or information that has been changed (eg, a role member). In addition, all DLL file relevance required for these applications may not be installed on the server correctly. Create, install, and configure a new COM application based on existing MTS applications. Only in this way ensures that your application is properly installed and configured in a new environment.

Operation Mode Before installing Windows 2000, make sure the application's document is the latest, especially the documentation related to the component configuration under MTS. Make sure the applications include:

Match the components under what software package. If the package is Server or Library. Verify level, role, and security settings. Application ID. Distributed Transaction Coordinator (DTC) log size, timeout. The properties of the transaction.

Non-specialized MTS record configuration information, for example:

DCOM verification and security settings. The privilege of the Identification of the MTS package and service. SQL Server Connection Configuration Settings. Any service that may have been installed (eg Microsoft Message Queuing Server (MSMQ) listener). Registry key. Network settings. Manually add hostname resolution (in Lmhosts or Hosts).

After the Windows 2000 is installed, complete the following steps:

Run the installer for the component to ensure that all the relevance required for these components is ready. If necessary, create a user (remember, in COM , in COM ), and grant these users necessary privileges. Create a needed COM Applications. It is now necessary to ensure that applications, packages, and interface properties match the settings in the MTS package. Add a role to the COM application. Add the components to the COM Application and configure them as needed. Set the correct role for objects and interfaces (and methods).

reference

For more information about Windows 2000 deployment, see "Consider the link to install Windows 2000" section from zero. For more information, see the "Knowledge Base" article.

Basic knowledge: Convert MTS package to COM Applications (Q252400) (English)

Keep the synchronization of the constructor and deployment target

When compiling the object to be run in Windows 2000, compile them and package them to deploy them on the Windows 2000 computer.

why

Many system DLLs, type libraries, and large number of resources dependent on the application may have changed from Windows NT to Windows 2000. As a rule, if the components compiled in NT 4.0 in Windows 2000, the system should not be dangerous, but why is there any risk? Because it is consistent with the test and deployment environment, you may have retained many difficult or resolved issues.

Operation method

If you want to deploy components in Windows 2000, use Windows 2000 computers as a constructor.

Clear interface forwarding

You may want to use the new beginning (it's not a new year, but a new operating system) to clear the object interface. If the construction process is not very strict, it will eventually appear as an interface forwarding. When the method or parameter is added to the component, the interface forwarding occurs when you want to keep binary compatibility. You should try to avoid interface forwarding.

Keep in mind that if the client uses early binding, you need to re-construct it with reference to the new DLL or class library. Depending on the distribution strategy, deployment costs may be difficult to explain with "clean interface".

Operation method

The easiest way to cancel the interface forward is:

Store the current DLL copy in a safe place (or rename it). Set "No Composition" and recompile the DLL in "Project" .. "Properties" .. "Components" and recompile the DLL. Set to "binary compatibility" and point to the saved DLL; recompile the DLL again.

why

MTS hardly works normally with components with interface forwarding, and this feature has little test. It also adds unnecessary complexity to registration, and some uninstalled programs are confused when processing this feature. details

If "Binary Compatibility" is set on the project, you can choose to break or maintain compatibility if you decide to add a method to the object later. If you choose to keep compatibility (don't try to do this), then VB will use a special COM registration function called an interface forwarding. This means that the old interface ID will be registered, but the information will forward to the new interface.

Add a method to the interface, or add an optional parameter to the function, absolutely requires the new IID of the interface. It fully concentrates for a simple thing - your IID identity interface (one thing) and its performance, rather than how the client uses it. Therefore, if the combination of all things that can be made to the interface change, the IID must also change. You can add it to your keyboard to add a key. You can assume that the previous user does not press this button. It can even decide not to re-print the manual. However, the SKU number of the keyboard must be changed.

reference

Keep binary compatibility (English) PRB: Error has been sent to the interface (Q222634) (English) Construction, version management and maintenance of Visual Basic Components in Visual Basic, MTS (English)

Use COM Windows 2000 Type Library and ProgID

Your components may have references to Transaction Server objects, Shared Property Manager, and more. In Windows 2000, the type library name has changed, so please check if your reference is correct, and whether you can create the required object.

When you bring DLL or EXE to Windows 2000, you can see that it is still capable of creating Administration and Shared Property objects - no matter the NEW keyword or createObject and Progids keywords.

details

The following table summarizes some of the most important changes. If the item references the MTS library, these references will be updated when turned on on a Windows 2000 computer, as described below.

MTScom Microsoft Transaction Server Type Library (MTXAS.DLL) COM Service Type Library (COMSVCS.DL) Shared Properties Manager Type Library (MTXSPM.DLL) COM Service Type Library (COMSVCS.DLL) MTS 2.0 Management Type Library (MtxAdmin.dll ) MTS 2.0 management type library (MTSADMIN.TLB)

The MTS Admin DLL reference has been converted to the MTS TLB reference to obtain backward compatibility. COM admin reference is a separate project. However, if you plan to use a COM Admin object, you need to read the document carefully because they support the collection, attributes, and methods have changed.

Operation method

As mentioned above, the working DLL will not destroy it in Windows 2000, at least if it is destroyed when the MTS object is created. When compiled in Windows 2000, some new problems may be found in the new type library name. The easiest solution is to remove the qualifier of the type library from the variable declaration. Use the following checklist to help you make changes.

If you have a variable declaration as:

Mtxspm.sharedProperty [...]

Change them to:

COMSVCSLIB.SHAREDPROPERTY [...]

Or delete the TypeLib qualifier:

Sharedproperty [...]

If you have a variable declaration as:

MTXAS.ObjectContext (or MTXAS. [...]) changes to:

ObjectContext

Progids mtsadmin.catalog, mtsadmin.catalog.1, and mtxspm.sharedProperty [...]. 1 Working properly under Windows 2000.

Familiar with new configuration options and terms

Familiar with all new configuration options that Com bring to objects. The article listed below outlines the new COM function. However, by browsing the "COM Component Service Manager" tree and computer, applications, objects, interfaces, methods, etc., you can have better understanding of the new option.

Understanding these settings before starting to use a lot of efficiency, and reading the following "Knowledge Base" article is a good start. You can also view MSDN and take a few minutes to read the main documentation. Interesting things will start when the sparks appear. The following "Knowledge Base" article provides useful links and helps to decide the most closely related to your relationship.

reference

Information: New Content of COM 1.0 (Q253669) (English)

Establish an effective management console

The efficiency of Windows 2000 is amazing on the management task, but the tools from Windows NT 4.0 have been transferred to a better location. Try to find the utility you use and combine them into your MMC console for easy use.

details

Some common tools used by MTS / COM developers and administrators are listed below, as well as their new location.

Transaction Server Explorer: Already moved to the Component Service (or "Component Service Manager" management unit. You can access it directly by clicking the Start button, click Programs, Management Tools, and Components. MSMQ Explorer: The "Computer Management" management unit that has been transferred to [Service and Application] ... [Message Queuing]. ODBC: It has been transferred to "Administrative Tools" ... "Data Source" [ODBC]. Local Security & Auditing: They can be found in Administrative Tools / Local Security Policies and Local Users and Groups. Event Viewer: Now it is a management unit. Service: It is now also a management unit.

Operation method

Save your own console by the following steps:

Click the Start button, then click Run, type the MMC. In the Console menu, you enter the Add / Delete Management unit. In the Add / Delete Administration Unit dialog (below Figure 1 below), click the Add button and select the required management unit.

You can use the following items:

Component Services Event Viewer SQL Server Enterprise Manager Internet Information Services Computer Management Local User and Group Performance Logs and Alert Service System Information Add "Links to Web Address" or MSDN Search, intranet site Or add the link to the most file sharing. If you feel that there are too many management units in the console, try to organize them into the folder. Go to the Console and select Options. Select "User Mode" to prevent further changes. Select the correct title and icon for it, choose whether to save your changes. Save the console into the MSC file that can be easily available. Drag the MSC file to the Start button to create a shortcut for it. It can even specify shortcut key sequences.

Figure 1. Convenient MMC Management Unit

"Terminal Services" can also be enabled for remote management. This will use other computers as the terminal of your server, avoiding the limitations encountered during remote usage standard management tools.

For more information on how to implement, see the link below.

reference

Windows 2000 Management Services (English) Using Terminal Services Remote Manage Windows 2000 Server Series (English)

View Windows 2000 Server Application Guidelines

Microsoft has released a series of guidelines related to the behavior and resource interaction of the application that must be maintained, which are designed for Windows 2000. Even if you are not interested in getting a formal certificate, you can also view its outlined practices, understand the formal definition of Microsoft's Windows 2000 application for "Normal Work".

reference

Application Specification for Windows 2000 Desktop Applications (English) Windows 2000 Server Application Specification (English)

转载请注明原文地址:https://www.9cbs.com/read-30467.html

New Post(0)