By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

COMM Class

P: n/a
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.

Nov 7 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hello Lou

Does your class expose a public sub new ??

cause this is required for a COM class

Regards

Michel Posseth [MCP]
"Lou" <lo********@comcast.netschreef in bericht
news:ea**************@TK2MSFTNGP02.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.

Nov 8 '06 #2

P: n/a
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.

Nov 8 '06 #3

P: n/a
Lou
yes it does?

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:u6**************@TK2MSFTNGP03.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" <lo********@comcast.netschreef in bericht
news:ea**************@TK2MSFTNGP02.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.


Nov 9 '06 #4

P: n/a
Lou
Error "Can' add a reference to the specified file"

"Chris Dunaway" <du******@gmail.comwrote in message
news:11********************@b28g2000cwb.googlegrou ps.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.

Nov 9 '06 #5

P: n/a
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/micro...996d74d250974e

regards

Michel Posseth [MCP]

"Lou" <lo********@comcast.netschreef in bericht
news:us**************@TK2MSFTNGP04.phx.gbl...
yes it does?

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:u6**************@TK2MSFTNGP03.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" <lo********@comcast.netschreef in bericht
news:ea**************@TK2MSFTNGP02.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.



Nov 12 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.