How to Use ProgID in VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eli

    How to Use ProgID in VB.NET

    Hi,

    simply put, I have a function that accepts a ProgID. I want to call
    that function providing the ProgID of a DLL project (made in VB.NET!!!
    NOT COM!). Can I do this? Do the Library projects created with VB.NET
    have a ProgID?

    thanks in advance. Any help will be appreciated

    Elias
    civil engineer
  • Patrick Steele [MVP]

    #2
    Re: How to Use ProgID in VB.NET

    In article <1d169d8a.04061 62256.7171a4f8@ posting.google. com>,
    eliasengin@msn. com says...[color=blue]
    > simply put, I have a function that accepts a ProgID. I want to call
    > that function providing the ProgID of a DLL project (made in VB.NET!!!
    > NOT COM!). Can I do this?[/color]

    Yes. See the Activator.Creat eInstance() method.
    [color=blue]
    > Do the Library projects created with VB.NET
    > have a ProgID?[/color]

    They have a fully-qualified name (namespace.obje ct) that the runtime
    uses to locate the proper assembly to load.

    --
    Patrick Steele
    Microsoft .NET MVP

    Comment

    • eli

      #3
      Re: How to Use ProgID in VB.NET

      > > Do the Library projects created with VB.NET[color=blue][color=green]
      > > have a ProgID?[/color]
      >
      > They have a fully-qualified name (namespace.obje ct) that the runtime
      > uses to locate the proper assembly to load.[/color]

      Thank you for your answer.
      The name you told me about (namespace.obje ct):
      1) where can I see it?
      2) Can I use it as a ProgID?

      thanks again
      Elias

      Comment

      • Patrick Steele [MVP]

        #4
        Re: How to Use ProgID in VB.NET

        In article <1d169d8a.04061 82318.1a3ec56a@ posting.google. com>,
        eliasengin@msn. com says...[color=blue][color=green]
        > > They have a fully-qualified name (namespace.obje ct) that the runtime
        > > uses to locate the proper assembly to load.[/color]
        >
        > Thank you for your answer.
        > The name you told me about (namespace.obje ct):
        > 1) where can I see it?[/color]

        If it's your component, the namespace is something you define with the
        "Namespace" statement (but becareful and check your project properties
        because VB.NET adds a "Initial namespace" and that can be confusing).

        Assuming the VB.NET project properties does *not* have an initial
        namespace declared, here's some examples defined in code:

        Namespace MyCompany
        Public Class Foo
        ...
        End Class
        End Namespace

        The fully qualified name of "Foo" is "MyCompany.Foo" . Another example
        (showing that a namespace can contain "."):

        Namespace ABC.Product.Wid gets
        Public Class Bar
        ...
        End Class
        End Namespace

        The fully qualified name of "Bar" is "ABC.Product.Wi dgets.Bar".
        [color=blue]
        > 2) Can I use it as a ProgID?[/color]

        You mean to create an instance of the class by name? Yes, see
        "Activator.Crea teInstance".

        --
        Patrick Steele
        Microsoft .NET MVP

        Comment

        Working...