02-04-2010 07:39 AM
02-04-2010 03:18 PM - edited 02-04-2010 03:23 PM
Russell1,
I'm going to try to give as thorough description as I can, since many other users may not understand what you're asking about.
Normally, a COM server (ActiveX servers are COM servers) is registered with Windows via the registry. Unfortunately, you can only have one version of the server registered at a time. This is one of the reasons why TestStand (which is a COM server) needs a version switcher to change between engine versions.
There is a technology called "Registration-free COM" that allows an application to use a COM server without having it registered in the windows registry. It involves creating manifest files for the COM server and for the application that is calling the com server. These manifest files are used by the operating system when the application tries to call the COM server to find the server. Usually the OS would go to the registry, but it will check the manifest files first.
The best reference on registration-free COM is an article on MSDN: Registration-Free Activation of COM Components: A Walkthrough.
A year or so ago, there was a TestStand customer who was interested in forcing some of their applications to use a certain version of a COM server; I was able to get this working for them.
I tested the .NET and MFC TestStand user interfaces, and found that I could get registration-free COM working with both. I found that two .manifest files needed to be created.
After creating both manifest files, I found that adding them was enough to make .NET calls to the COM server work correctly if the application and server were in the same directory.
Unfortunately, I did not do any testing with having the COM server in a different directory.
Now, on to your question:
I just did some poking around on MSDN, and I have found the following information.
Note that after you have configured a .manifest file for your COM server, it is then referred to as an "assembly". I am making an assumption here (but I think it's a reasonable assumption) that after this, the COM server can be used just like any other assembly. Specifically, it will be searched for in the same way an assembly is searched for.
MSDN documents How the Runtime Locates Assemblies. Note near the bottom of that page, if the assembly has not been bound to before, and it is not in the Global Assembly Cache (GAC), it will probe for the assembly. From this I think the following are possible solutions. Please note that I haven't tested any of them.
I honestly don't know if any of these possibilities will work. Please let me know if you get it working or if you need some more help, and I'll do my best to assist you.