.NET Framework Developer Center > .NET Development Forums > Common Language Runtime > Where is the interface identifier (IID) located for a Com+ app?
Ask a questionAsk a question
 

AnswerWhere is the interface identifier (IID) located for a Com+ app?

  • Tuesday, October 27, 2009 6:07 PMVocono Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Need this to check if it remains unchanged after export of Com+ app. ICLSID and TypeLibID are simple to find. But cannot find the IID.

    Can anyone offer so help?

    Thank you.

    -Bob

Answers

  • Tuesday, October 27, 2009 11:05 PMnobugzMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Oleview.exe, File + View Type Library.  Don't leave it up to chance, apply the [Guid] attribute.
    Hans Passant.
  • Wednesday, October 28, 2009 9:17 AMJialiang Ge [MSFT]MSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Thanks Hans. It's a good idea to find the interface ID from type library.

    Because it's a COM+ component, another way to quickly locate the IID value is

    step1. open dcomcnfg
    step2. navigate to Component Services / Computers / My Computer / COM+ Applications / <You COM+ Application name> / Components / <You Component Name> / Interfaces / <Your Interface>. Open the interface's property. You will see its IID.

    Please let me know if you have any other questions or concerns.


    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

All Replies

  • Tuesday, October 27, 2009 11:05 PMnobugzMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Oleview.exe, File + View Type Library.  Don't leave it up to chance, apply the [Guid] attribute.
    Hans Passant.
  • Wednesday, October 28, 2009 9:17 AMJialiang Ge [MSFT]MSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Thanks Hans. It's a good idea to find the interface ID from type library.

    Because it's a COM+ component, another way to quickly locate the IID value is

    step1. open dcomcnfg
    step2. navigate to Component Services / Computers / My Computer / COM+ Applications / <You COM+ Application name> / Components / <You Component Name> / Interfaces / <Your Interface>. Open the interface's property. You will see its IID.

    Please let me know if you have any other questions or concerns.


    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • Thursday, October 29, 2009 5:31 PMVocono Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thank you, guys. nobugs, I could not launch Oleview.exe. Windows says it does not exist?!

    I found the IID using dcomcnfg. No wonder I couldn't find it :)

    The ids, CLSID and TypeLibID, in the post-export app match the pre-export app, match. But, the IIDs do not match.

    It is a VB 6 com+ app running on Windows 2000.

    How is the the [Guid] attribute applied?

    Thanks again for your help!

    -Vocono




    • Edited byVocono Friday, October 30, 2009 5:23 PM
    •  
  • Monday, November 02, 2009 5:30 AMJialiang Ge [MSFT]MSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hello Vocono

    OLEView is available in Windows SDK. You would need to install Windows SDK tools first, and launch the tool from Windows SDK command shell. You may also try this download: http://www.microsoft.com/downloads/details.aspx?familyid=5233b70d-d9b2-4cb5-aeb6-45664be858b6&displaylang=en, but it's a very old version of OLEVIEW for Windows 2000, and may not work properly in newer operating system.


    > The ids, CLSID and TypeLibID, in the post-export app match the pre-export app, match. But, the IIDs do not match.
    In VB6, you need to enable binary compatibilty when build every new release. However, please understand that VB6 IDE is no longer supported. You may consider upgrading the component to VB.NET.


    >How is the the [Guid] attribute applied?
    [Guid] is for .NET. It allows you to explicitly specify the IID, CLSID, and etc of your COM component. In this way, the IDs will match in different builds of your component. For example, in C#, you do it like this:

        [Guid("32DBA9B0-BE1F-357D-827F-0196229FA0E2")]          // IID
        // The public interface describing the COM interface of the coclass
        public interface ICSSimpleObject2
        {

    and in VB.NET, you can explicitly define the IDs like this:

    <ComClass(VBSimpleObject.ClassId, VBSimpleObject.InterfaceId, _
              VBSimpleObject.EventsId)> _
    Public Class VBSimpleObject

        Public Const ClassId As String _
        = "805303FE-B5A6-308D-9E4F-BF500978AEEB"
        Public Const InterfaceId As String _
        = "90E0BCEA-7AFA-362A-A75E-6D07C1C6FC4B"
        Public Const EventsId As String _
        = "72D3EFB2-0D88-4ba7-A26B-8FFDB92FEBED"


    I have working examples for you that are written in C# and VB.NET. They are in-process COM components, and you can further register them as COM+:

    All-In-One Code Framework
    http://cfx.codeplex.com

    Please check out the samples: CSDllCOMServer and VBDllCOMServer.

    If you have any other questions, please feel free to tell me.


    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • Wednesday, November 04, 2009 6:03 AMJialiang Ge [MSFT]MSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Vocono

    How are you? If you have any other questions or concerns, please feel free to post here.
    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • Thursday, November 05, 2009 6:52 PMVocono Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Jialiang, thank you for all that info. You gave me so much, my head is spinning :)

    The issue is now my lack of almost any understanding and knowledge about VB.Net. I wrote this app about 3 years ago in VB6 and there is about 14-15000 lines of code. Converting it to .NET is well beyond me at this time.

    So, how can I change the IID without using .NET? I ran OLEView and it displayed plenty of info on one of the app component, but I see no way to alter an ID. Tried to change it in the registry, but all I could find is the TypeLib for the component.

    Is this possible? Thank you for your help.

    -Vocono

  • Monday, November 09, 2009 3:26 AMJialiang Ge [MSFT]MSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Vocono

    Please check out these articles:
    http://blogs.msdn.com/adam_nathan/archive/2003/10/19/56779.aspx
    http://www.vbaccelerator.com/progid.htm
    They provide some hints for you to specify the GUID. However, as VB6 IDE is no longer supported, I did not verify these solutions.


    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • Thursday, November 12, 2009 9:40 AMJialiang Ge [MSFT]MSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Vocono

    How are you? Did the articles in my last reply help you?


    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
  • Tuesday, November 17, 2009 10:54 PMVocono Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Jialiang,

    Sorry to take so long to reply. Yes, I did read through much of info you referred to me.

    Unfortunately, my .NET knowledge is weak to non-existent. So far as I can now see, my manager and I will have to deploy a new proxy when the app is exported to the new server. Hopefully, the MS Installer will work properly--it can be unreliable when installing proxies.

    Thank you for all that info. It will no doubt be useful sometime in the near future when I learn VB.NET.

    -Vocono