简体   繁体   中英

How can I get configured for multiple versions of a COM server in the registry?

I've got multiple versions (major and minor) of an application and would like to have a setup in my registry like a program like AutoCAD. Here's an example in my registry:

在此处输入图片说明

As you can see here, AutoCAD.Application is just pointing to the version of AutoCAD that was most recently executed. Each version has its own COM server (which I could figure out how to do in my IDE, Delphi XE). The CLSID key contains the same information that AutoCAD.Application.19 -> CLSID has and this changes whenever a different version is executed.

What my question is, is there an automatic way or a utility that already adds a parent COM object in the registry and populates the CLSID and Current Version (CurVer) of my application?

If there is not an automatic way of doing this, what would doing this manually look like? Even if your answer is not in Delphi/Pascal language I'll have a look at it.

Any help is appreciated as I'm in an unknown area where Google has not been helping me like it usually does.

What you're looking for is a version-independent PROGID . These aren't COM objects; they're just registry entries used to resolve human-readable PROGIDs to computer-friendly CLSIDs.

Typically, your application will have two PROGIDs per class - one version-independent, one version-dependent. The version-independent PROGID forwards to a version-dependent PROGID, which then resolves to a CLSID.

As you release new versions of your application, you would create new CLSIDs for the new version, add a new version-dependent PROGID that maps to the new CLSID, and update the CurVer subkey of the version-independent PROGID to point to your new version-dependent PROGID.

Larry Osterman goes into more detail in his series about how COM registration really works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM