Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Thu, 1 Jun 2006 11:17:23 +0200,    group: microsoft.public.platformsdk.com_ole        back       


Specify Version when loading a Component by it's CLSID   
Hi everybody!

Scenario: I'm developing a Tool (AddIn via COM) by using C# (with all the 
COM - Attributes). Making the hosting application (witch is Visual Studio) 
to "know" my tool is done via the Registry. I have to create a well known 
key and have to specifiy the CLSID of the AddIn Class.

The tool well - until now. Ok, it still works, but it has to support the new 
version of the hosting application (VS.Net 2005). Becaurse I import 
(reference) libraries from the hosting application, the old version has to 
be compiled by using the new libraries.

This is still no problem, becaurse the COM Support in the .Net Framework is 
aware of Versioning. If you use regasm to register a new version to be 
callable by COM, it doesn't replace the old version. Both versions can be 
loading indiviually. I can use a tiny vbs to test this:

set oldVersion = CreateObject("MyProgId.1.0")
set newVersion = CreateObject("MyProgId.2.0")

The problem is:
I cannot specify a ProgId (including the version) in the hosts registration 
database (registry). I have to specify a GUID.

The question is:
Becaurse I strongly asume, that the host is using standard - COM functions 
to load the AddIn, I will have to find a way to specify the version along 
the CLSID. Do you know any possibilty to do so?

A workaroud would be to compile the new version by using a new CLSID. But I 
do not like this solution. I would only choose it if there is no other way!


thank you very much!


br
Guenter Prossliner
date: Thu, 1 Jun 2006 11:17:23 +0200   author:   Gnter Prossliner g.prossliner/gmx/at

Re: Specify Version when loading a Component by it's CLSID   
"Gnter Prossliner" <g.prossliner/gmx/at> wrote in message
news:%23qglywVhGHA.1264@TK2MSFTNGP05.phx.gbl
> Becaurse I strongly asume, that the host is using standard - COM
> functions to load the AddIn, I will have to find a way to specify the
> version along the CLSID. Do you know any possibilty to do so?
>
> A workaroud would be to compile the new version by using a new CLSID.
> But I do not like this solution. I would only choose it if there is
> no other way!

There is no other way. A CLSID uniquely identifies the component's 
binary. ProgID versioning works because MyProgId.1.0 and MyProgId.2.0 
point to different CLSIDs
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Thu, 1 Jun 2006 08:03:36 -0400   author:   Igor Tandetnik

Re: Specify Version when loading a Component by it's CLSID   
Hello Igor!

>> A workaroud would be to compile the new version by using a new CLSID.
>> But I do not like this solution. I would only choose it if there is
>> no other way!
>
> There is no other way. A CLSID uniquely identifies the component's
> binary. ProgID versioning works because MyProgId.1.0 and MyProgId.2.0
> point to different CLSIDs

Thank you very very much for this information! I was not aware of it. But by 
browsing the Registry I can exactly see this behavior.

br
Gnter Prossliner
date: Thu, 1 Jun 2006 18:37:23 +0200   author:   Gnter Prossliner g.prossliner/gmx/at

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us