COMM Class

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

    #1

    COMM Class

    I created a comclass from VB .NET 2005 but it fails when I try to load it
    (.dll)
    into VB6.
    I followed these instructions
    To create a COM object using the COM class template
    1.. Open a new Windows Application project from the File menu by clicking
    New Project.

    2.. In the New Project dialog box under the Project Types field, check
    that Windows is selected. Select Class Library from the Templates list, and
    then click OK. The new project is displayed.

    3.. Select Add New Item from the Project menu. The Add New Item dialog box
    is displayed.

    4.. Select COM Class from the Templates list, and then click Add. Visual
    Basic adds a new class and configures the new project for COM interop.

    5.. Add code such as properties, methods, and events to the COM class.

    6.. Select Build ClassLibrary1 from the Build menu. Visual Basic builds
    the assembly and registers the COM object with the operating system.



  • Michel Posseth  [MCP]

    #2
    Re: COMM Class

    Hello Lou

    Does your class expose a public sub new ??

    cause this is required for a COM class

    Regards

    Michel Posseth [MCP]


    "Lou" <lou.garvin@com cast.netschreef in bericht
    news:eaWemisAHH A.4672@TK2MSFTN GP02.phx.gbl...
    >I created a comclass from VB .NET 2005 but it fails when I try to load it
    >(.dll)
    into VB6.
    I followed these instructions
    To create a COM object using the COM class template
    1.. Open a new Windows Application project from the File menu by clicking
    New Project.
    >
    2.. In the New Project dialog box under the Project Types field, check
    that Windows is selected. Select Class Library from the Templates list,
    and
    then click OK. The new project is displayed.
    >
    3.. Select Add New Item from the Project menu. The Add New Item dialog
    box
    is displayed.
    >
    4.. Select COM Class from the Templates list, and then click Add. Visual
    Basic adds a new class and configures the new project for COM interop.
    >
    5.. Add code such as properties, methods, and events to the COM class.
    >
    6.. Select Build ClassLibrary1 from the Build menu. Visual Basic builds
    the assembly and registers the COM object with the operating system.
    >
    >
    >

    Comment

    • Chris Dunaway

      #3
      Re: COMM Class

      Lou wrote:
      I created a comclass from VB .NET 2005 but it fails when I try to load it
      (.dll)
      into VB6.
      Give us a hint. What do you mean by "it fails"? Is there an error
      message? Does the class show up on the references page in VB6? Some
      information about the actual problem would be helpful.

      Comment

      • Lou

        #4
        Re: COMM Class

        yes it does?

        "Michel Posseth [MCP]" <MSDN@posseth.c omwrote in message
        news:u6yhE5vAHH A.3536@TK2MSFTN GP03.phx.gbl...
        Hello Lou
        >
        Does your class expose a public sub new ??
        >
        cause this is required for a COM class
        >
        Regards
        >
        Michel Posseth [MCP]
        >
        >
        "Lou" <lou.garvin@com cast.netschreef in bericht
        news:eaWemisAHH A.4672@TK2MSFTN GP02.phx.gbl...
        >>I created a comclass from VB .NET 2005 but it fails when I try to load it
        >>(.dll)
        >into VB6.
        >I followed these instructions
        >To create a COM object using the COM class template
        > 1.. Open a new Windows Application project from the File menu by
        >clicking
        >New Project.
        >>
        > 2.. In the New Project dialog box under the Project Types field, check
        >that Windows is selected. Select Class Library from the Templates list,
        >and
        >then click OK. The new project is displayed.
        >>
        > 3.. Select Add New Item from the Project menu. The Add New Item dialog
        >box
        >is displayed.
        >>
        > 4.. Select COM Class from the Templates list, and then click Add. Visual
        >Basic adds a new class and configures the new project for COM interop.
        >>
        > 5.. Add code such as properties, methods, and events to the COM class.
        >>
        > 6.. Select Build ClassLibrary1 from the Build menu. Visual Basic builds
        >the assembly and registers the COM object with the operating system.
        >>
        >>
        >>
        >
        >

        Comment

        • Lou

          #5
          Re: COMM Class

          Error "Can' add a reference to the specified file"

          "Chris Dunaway" <dunawayc@gmail .comwrote in message
          news:1162995977 .115653.4630@b2 8g2000cwb.googl egroups.com...
          Lou wrote:
          >I created a comclass from VB .NET 2005 but it fails when I try to load it
          >(.dll)
          >into VB6.
          >
          Give us a hint. What do you mean by "it fails"? Is there an error
          message? Does the class show up on the references page in VB6? Some
          information about the actual problem would be helpful.
          >

          Comment

          • Michel Posseth  [MCP]

            #6
            Re: COMM Class

            some tips :


            1. you must have a sub new in your to COM exposed class ( the
            constructor must be without parameters )
            Public Sub New()


            MyBase.New()


            End Sub


            2. provide your own id`s ClassId , InterfaceId and EventsId


            register the dll with Regasm instead of regsvr

            here an example





            regards



            Michel Posseth [MCP]





            "Lou" <lou.garvin@com cast.netschreef in bericht
            news:usSeyQBBHH A.1012@TK2MSFTN GP04.phx.gbl...
            yes it does?
            >
            "Michel Posseth [MCP]" <MSDN@posseth.c omwrote in message
            news:u6yhE5vAHH A.3536@TK2MSFTN GP03.phx.gbl...
            >Hello Lou
            >>
            >Does your class expose a public sub new ??
            >>
            >cause this is required for a COM class
            >>
            >Regards
            >>
            >Michel Posseth [MCP]
            >>
            >>
            >"Lou" <lou.garvin@com cast.netschreef in bericht
            >news:eaWemisAH HA.4672@TK2MSFT NGP02.phx.gbl.. .
            >>>I created a comclass from VB .NET 2005 but it fails when I try to load it
            >>>(.dll)
            >>into VB6.
            >>I followed these instructions
            >>To create a COM object using the COM class template
            >> 1.. Open a new Windows Application project from the File menu by
            >>clicking
            >>New Project.
            >>>
            >> 2.. In the New Project dialog box under the Project Types field, check
            >>that Windows is selected. Select Class Library from the Templates list,
            >>and
            >>then click OK. The new project is displayed.
            >>>
            >> 3.. Select Add New Item from the Project menu. The Add New Item dialog
            >>box
            >>is displayed.
            >>>
            >> 4.. Select COM Class from the Templates list, and then click Add.
            >>Visual
            >>Basic adds a new class and configures the new project for COM interop.
            >>>
            >> 5.. Add code such as properties, methods, and events to the COM class.
            >>>
            >> 6.. Select Build ClassLibrary1 from the Build menu. Visual Basic builds
            >>the assembly and registers the COM object with the operating system.
            >>>
            >>>
            >>>
            >>
            >>
            >
            >

            Comment

            Working...