Please help! CommandBar in VB.NET

[ Edited ]


I'm try to develop a VB.NET add-in.

Actually many things work but I've got a huge problem...

I can't enable any buttons in toolbar, manage events or associate code on it

VB.NET response error "Unable to cast COM object of type 'System.__ComObject' to interface type 'SolidEdgeFramework.CommandBarButtonEvents'" while trying to associate button events object

here's the code

Dim WithEvents m_ButtonEvents1 As SolidEdgeFramework.CommandBarButtonEvents

Dim m_Button1 As SolidEdgeFramework.CommandBarButton

m_Button1=objCommandBars.FindControl(SolidEdgeConstants.SeControlType.seControlButton, 1, "Replace")

If Not m_Button1 Is Nothing Then

  'Button exists. Simply connect up to the events to enable the button ERROR HERE!!!!!

  m_ButtonEvents1 = m_Button2.CommandBarButtonEvents

End If

please help!







Posted by: tecnico sygest
Post date: 3/30/2010 5:48:19 AM