locked
COM DLL ProgID Registration RRS feed

  • Question

  • When I created COM DLL's with C++, I could use the rgs file to control the registration process and create versions of the DLL. The ProgID registry entry would be distinguished by appending the version level to the end of the ProgID.

     

    For example:

     

    XXXX.YYYY

        CLSID = ....

        CurVer = XXXX.YYYY.3.1

    XXXX.YYYY.2.1

        CLSID = ....

    XXXX.YYYY.3.1

        CLSID = ....

     

    This allowed different release levels to co-exist and the user could qualify the ActiveXObject creation by using the appropriate ProgID.

     

    I have been unable to create the equivalent structure with CSharp projects that create COM DLLs. I can not get the registration process to append the release level to the ProgID. How do you do this with the CSharp projects?

     

    My problem has to do with the fact that the CSharp project seems to hide the registry guid information. I have been able to use the regasm tool to create a registry file which show the guids in the registered dll. I can then modify the registry file to create the required registry version information, but all of these steps are accident prone. With the rgs files, I could use include files that contain the guids. This allow me to control what the guids are and when they are changed. I do not have similar control of CSharp projects.

     

     

     

     

    Thursday, May 17, 2007 2:07 PM

Answers

  • Do you place the attribute ProgID

    [ProgId("ProjectName.ClassName.Version.Subversion")]

    above the target class? Or am I missing something?

    Tuesday, May 22, 2007 4:37 PM

All replies

  • Do you place the attribute ProgID

    [ProgId("ProjectName.ClassName.Version.Subversion")]

    above the target class? Or am I missing something?

    Tuesday, May 22, 2007 4:37 PM
  • I think I have not explained myself correctly. The real problem is the ease of changing the version level information when making a new release. With C++, I used a header file containing the version information. This header file is included in the rgs files for the com projects. The defines in the version.h file are then used to create the registry information such as

     

    ProgID = s '%PRODUCTNODE%.ClassName.%RELEASEVERSION%'

     

    When I try to do something similar with the ProgID attribute, I get the error

     

    "An attribute argument must be a constant expression, typeof expression or array creation expression."

     

    I can change the ProgID in the individual project files, but I want to be able to change the version information one place and have it picked up by all of my projects.

     

    How can I create the attribute argument using a technique like the example above?

    Tuesday, May 29, 2007 3:30 PM
  • I have resolved the problem. Thank you for your help.

     

    Wednesday, May 30, 2007 5:22 PM
  • What did you do to resolve it? So that other's searching can reference your post. Thanks.
    Wednesday, May 30, 2007 6:00 PM