mpdillon
asked on
VS COM Class Properties not visible to other VS WinForms Projects
I have created a COM Class application. It contains 20 public properties. When I reference this COM Class in a new Visual Basic 2008 project, most of the public properties are not visible.
The Com Class code is shown below.
As you can see there are 20 public properties. I created a new project. I added a reference to this COM Class which has be installed on the local computer. In the attached image you can see that most of the properties are not available to the new project. Why is this? What do need to change?
I also opened Excel. Added the .tlb reference to a macro and was able to see all the properties.
Why are all the properties visible to excel but not to a new visual studio project?
Thanks in advance,
pat
Properties.PNG
The Com Class code is shown below.
<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _
Public Class ComClass1
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "fe970657-2cf0-40a5-a337-19dadff0ae6f"
Public Const InterfaceId As String = "76bcf530-675a-4f79-95d3-e4d08b221e37"
Public Const EventsId As String = "4f993324-5613-4fe7-a6f5-149879d848a4"
#End Region
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
Public Property JIRConn() As String
Get
Return PublicVariables.JIRConnInfoStringP
End Get
Set(ByVal Value As String)
PublicVariables.JIRConnInfoStringP = Value
End Set
End Property
Public Property CusNo() As String
Get
Return PublicVariables.CusNoStringP
End Get
Set(ByVal Value As String)
PublicVariables.CusNoStringP = Value
End Set
End Property
Public Property OrdNo() As String
Get
Return PublicVariables.OrdNoStringP
End Get
Set(ByVal Value As String)
PublicVariables.OrdNoStringP = Value
End Set
End Property
Public Property ShowGeneralNotes() As Boolean
Get
Return PublicVariables.ShowGeneralNotesBooleanP
End Get
Set(ByVal Value As Boolean)
PublicVariables.ShowGeneralNotesBooleanP = Value
End Set
End Property
Public Property MacConn() As String
Get
Return PublicVariables.MacConnInfoStringP
End Get
Set(ByVal Value As String)
PublicVariables.MacConnInfoStringP = Value
End Set
End Property
Public Property InvNo() As String
Get
Return PublicVariables.InvNoStringP
End Get
Set(ByVal Value As String)
PublicVariables.InvNoStringP = Value
End Set
End Property
Public Property SaveBoolean() As Boolean
Get
Return PublicVariables.SaveBooleanP
End Get
Set(ByVal Value As Boolean)
PublicVariables.SaveBooleanP = Value
End Set
End Property
Public Property SaveCallNotesBoolean() As Boolean
Get
Return PublicVariables.SaveCallNotesBooleanP
End Get
Set(ByVal Value As Boolean)
PublicVariables.SaveCallNotesBooleanP = Value
End Set
End Property
Public Property SaveShippingNotesBoolean() As Boolean
Get
Return PublicVariables.SaveShippingNotesBooleanP
End Get
Set(ByVal Value As Boolean)
PublicVariables.SaveShippingNotesBooleanP = Value
End Set
End Property
Public Property SaveARNotesBoolean() As Boolean
Get
Return PublicVariables.SaveARNotesBooleanP
End Get
Set(ByVal Value As Boolean)
PublicVariables.SaveARNotesBooleanP = Value
End Set
End Property
Public Property SaveGeneralNotesBoolean() As Boolean
Get
Return PublicVariables.SaveGeneralNotesBooleanP
End Get
Set(ByVal Value As Boolean)
PublicVariables.SaveGeneralNotesBooleanP = Value
End Set
End Property
Public Property A4GLIdentityString() As String
Get
Return PublicVariables.A4GLIdentityStringP
End Get
Set(ByVal Value As String)
PublicVariables.A4GLIdentityStringP = Value
End Set
End Property
Public Property IDNoString() As String
Get
Return PublicVariables.IDNoStringP
End Get
Set(ByVal Value As String)
PublicVariables.IDNoStringP = Value
End Set
End Property
Public Property RMAIDNoString() As String
Get
Return PublicVariables.RMAIDNoStringP
End Get
Set(ByVal Value As String)
PublicVariables.RMAIDNoStringP = Value
End Set
End Property
Public Property SourceString() As String
Get
Return PublicVariables.SourceStringP
End Get
Set(ByVal Value As String)
PublicVariables.SourceStringP = Value
End Set
End Property
Public Property ItemNo() As String
Get
Return PublicVariables.ItemNoStringP
End Get
Set(ByVal Value As String)
PublicVariables.ItemNoStringP = Value
End Set
End Property
Public Property s() As String
Get
Return PublicVariables.sStringP
End Get
Set(ByVal Value As String)
PublicVariables.sStringP = Value
End Set
End Property
Public Property LotNo() As String
Get
Return PublicVariables.LotNoStringP
End Get
Set(ByVal Value As String)
PublicVariables.LotNoStringP = Value
End Set
End Property
Public Property CursorFocusBox() As String
Get
Return PublicVariables.CursorFocusBoxStringP
End Get
Set(ByVal Value As String)
PublicVariables.CursorFocusBoxStringP = Value
End Set
End Property
Public Property DiscountPct() As String
Get
Return PublicVariables.DiscountPctStringP
End Get
Set(ByVal Value As String)
PublicVariables.DiscountPctStringP = Value
End Set
End Property
Public Sub DisplayNotes()
'Descript of where used ==> value of SourceString
'OE>View>Order History>OrdNo/InvNo OEHIST
'vb6 RMAProcessing RMA
Main.ReadINI()
Select Case SourceString
Case "OEHIST"
'.SourceString = "OEHIST"
'.CusNo = "H00900"
'.OrdNo = "49361131"
'.InvNo = "778123"
'.SaveARNotesBoolean = False
'.SaveGeneralNotesBoolean = True
Main.ChooseNoteType()
Case "RMA"
'.SourceString = "RMA"
'.IDNoString = "1455" = RMA Header IDNo
Main.ShowRMANotes()
Case "OEORD"
'.SourceString = "OEORD"
'.CusNo = "N00200"
'.OrdNo = "493600200"
'.InvNo = "0"
'.SaveARNotesBoolean = False
'.SaveGeneralNotesBoolean = True
Main.ChooseNoteType()
Case "ALLNOTES"
Main.AllNotes()
Case "ARNOTESONLY"
'Set the SourceString to "ARNOTESONLY"
Main.ShowARNotesOnly()
Case "CUSNOTES"
Main.ShowCustomerNotes()
Case "OEITEMINFO"
Main.OEItemInfo()
Case "FORMATTING"
'Read Ini sets the ADODB connection strings
PublicVariables.ItemNoStringP = "115-475-008"
PublicVariables.DiscountPctStringP = "5"
PublicVariables.LotNoStringP = ""
PublicVariables.OrdNoStringP = ""
'Main.Formatting()
Main.DisplayProductInformation()
Case "ITEMINFORMATION"
'Read Ini sets the ADODB connection strings
Main.DisplayProductInformation()
Case "PRODUCTAVAILABILITY"
Main.DisplayProductAvailability()
Case "RMANOTES"
Main.ShowRMANotes()
Case "ITEMNOTES"
Main.RetrieveItemNotesAsString()
End Select
End Sub
End Class
As you can see there are 20 public properties. I created a new project. I added a reference to this COM Class which has be installed on the local computer. In the attached image you can see that most of the properties are not available to the new project. Why is this? What do need to change?
I also opened Excel. Added the .tlb reference to a macro and was able to see all the properties.
Why are all the properties visible to excel but not to a new visual studio project?
Thanks in advance,
pat
Properties.PNG
Probably because you are looking at the "Common" tab of the intellisense. Try clicking on All tab and see if it shows all properties.
ASKER
I thought about that also after I posted. See attached screen shot. I still do not see the majority of the properties. So strange.
Other ideas?
pat
Properties-2.PNG
Other ideas?
pat
Properties-2.PNG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes. I have added properties. I had also created a Setup program for the DLL. I rebuilt the DLL and setup program. I ran the setup program and the newer DLL was placed on the local machine. I "ASSUMED" the setup program would unregister and ten reregister the DLL. I was wrong.
You suggestion worked great. Using Regasm, I unregistered the DLL and reregistered it. Now all the properties are visible.
Thank you.
You suggestion worked great. Using Regasm, I unregistered the DLL and reregistered it. Now all the properties are visible.
Thank you.