Object browser not showing members

bacon7181

New member
Joined
Aug 21, 2003
Messages
4
Heres the scoop

Im developing some classes with VB.NET for use with Office2000

So, I need to be able to use .NET components via COM right?

So I followed the directions given here:
http://msdn.microsoft.com/library/en-us/dndotnet/html/callnetfrcom.asp

.. and successfully created a .NET component that I can reference and call from within Outlook 2000.

YAY

Only thing is, Outlooks VBA Object Browser wont show me any of the members of my class. It WILL show me all the members of my interface, but not the class.

This is only an annoyance but Id rather like to have it work correctly.

Anyone have experience with this or have any ideas?

Thanks in advance

Brian
 
I found the answer to my question and have written it in an informational format.

I have been in the need to create classes that I can call from Office 2000 in VB.NET for a couple weeks. I searched the MSDN and elsewhere online and came up with what I thought would be the answer: Calling a .NET Component from a COM Component. This walks through creating a new class, registering it and calling it from a COM component. However, I found that Offices Object Browser would not see the members of my class (even if they were public). If I created a public interface and derived my class from it I could then see the members of the interface but still not the class. After further research (well, actually an accidental stumbling while trying to research a completely different problem) I have found the proper answer here: Walkthrough: Creating COM Objects with Visual Basic .NET. I dont know what use the first article is to anyone but the second article is much easier and works correctly
[VB]

In the Project Properties under Configuration Properties -> Build
Check the Register for COM Interop check box.


Add the ComClass attribute specifying GUIDs for Class, Interface, and Events
<ComClass(TestClass.ClassId, TestClass.InterfaceId, TestClass.EventsId)> _
Public Class TestClass

Be sure to use your GUID generation utility on your Tools menu
Public Const ClassId As String = "7F8B3FA3-26F9-48c7-8E7D-24BEF88A637C"
Public Const InterfaceId As String = "A990F88D-B73B-4838-98D2-B4C893E621C1"
Public Const EventsId As String = "A7AC7645-7FBD-41e4-B30D-664F02827AB0"

COM requires a public parameterless New()
Public Sub New()
MyBase.New()
End Sub

Insert class members here.
Public Sub HelloWorld()
MsgBox "Saying Hello from your class library."
End Function

End Class
[/VB]
 
Back
Top