COMM Class

L

Lou

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.
 
M

Michel Posseth [MCP]

Hello Lou

Does your class expose a public sub new ??

cause this is required for a COM class

Regards

Michel Posseth [MCP]
 
C

Chris Dunaway

Lou said:
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.
 
L

Lou

yes it does?

Michel Posseth said:
Hello Lou

Does your class expose a public sub new ??

cause this is required for a COM class

Regards

Michel Posseth [MCP]


Lou said:
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.
 
M

Michel Posseth [MCP]

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

http://groups.google.com/group/micr...l+posseth+COM+VB.Net&rnum=28#ca996d74d250974e



regards



Michel Posseth [MCP]





Lou said:
yes it does?

Michel Posseth said:
Hello Lou

Does your class expose a public sub new ??

cause this is required for a COM class

Regards

Michel Posseth [MCP]


Lou said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top