Message 1 of 2
Add-in doesn´t load - Help

Not applicable
02-05-2008
04:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI everyone!
I have made a add-in that is not loading.
I have made the following class:
Option Explicit
Implements ApplicationAddInServer
Dim oapp As Inventor.Application
Private WithEvents MyAppEv As ApplicationEvents
Private WithEvents oButtonDef As ButtonDefinition
Private Sub ApplicationAddInServer_Activate(ByVal AddInSiteObject As Inventor.ApplicationAddInSite, ByVal FirstTime As Boolean)
' Save a reference to the Application object.
Set oapp = AddInSiteObject.Application
Set MyAppEv = oapp.ApplicationEvents
Dim oIcon1 As IPictureDisp
Set oIcon1 = LoadPicture(App.Path & "\SplitTable.ico")
Set oButtonDef = oapp.CommandManager.ControlDefinitions.AddButtonDefinition("copia0", "{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}", "copia0app", "copia0app1", oIcon1, oIcon1)
If FirstTime = True Then
'create a new toolbar
Dim oCommandBar As CommandBar
Set oCommandBar = oapp.UserInterfaceManager.CommandBars.Add("copia0", "copia00ToolbarIntName", , "{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}")
'add the buttons to the toolbar
oCommandBar.Controls.AddButton oButtonDef
'make the toolbar visible
oCommandBar.Visible = True
End If
End Sub
Private Property Get ApplicationAddInServer_Automation() As Object
Set ApplicationAddInServer_Automation = Nothing
End Property
Private Sub ApplicationAddInServer_Deactivate()
If Form1.Visible = True Then
Unload Form1
End If
oButtonDef.Delete
Set oButtonDef = Nothing
Set oapp = Nothing
End Sub
Private Sub ApplicationAddInServer_ExecuteCommand(ByVal CommandID As Long)
End Sub
Private Sub oButtonDef_OnExecute(ByVal Context As Inventor.NameValueMap)
Form1.Show
End Sub
Then i have made the regsvr32 command
and i add the following to the registry:
REGEDIT4
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}]
@="Clona assemblys"
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Description]
@="Clona e renomeia Assemblys"
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Implemented Categories\{39AD2B5C-7A29-11D6-8E0A-0010B541CAA8}]
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Required Categories]
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Required Categories\{39AD2B5C-7A29-11D6-8E0A-0010B541CAA8}]
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Settings]
"LoadOnStartUp"="1"
"Type"="Standard"
"SupportedSoftwareVersionGreaterThan"="9.."
When i go to tools->add-ins in the add-in manager the load behavior is startup/unloaded, i try to make load in the add-in manager, but this is not working too.
Then i go to tools->customize->commands->add-ins and the icon was not loaded.
Can someone help me to understand what is wrong here?
Thanks.
I have made a add-in that is not loading.
I have made the following class:
Option Explicit
Implements ApplicationAddInServer
Dim oapp As Inventor.Application
Private WithEvents MyAppEv As ApplicationEvents
Private WithEvents oButtonDef As ButtonDefinition
Private Sub ApplicationAddInServer_Activate(ByVal AddInSiteObject As Inventor.ApplicationAddInSite, ByVal FirstTime As Boolean)
' Save a reference to the Application object.
Set oapp = AddInSiteObject.Application
Set MyAppEv = oapp.ApplicationEvents
Dim oIcon1 As IPictureDisp
Set oIcon1 = LoadPicture(App.Path & "\SplitTable.ico")
Set oButtonDef = oapp.CommandManager.ControlDefinitions.AddButtonDefinition("copia0", "{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}", "copia0app", "copia0app1", oIcon1, oIcon1)
If FirstTime = True Then
'create a new toolbar
Dim oCommandBar As CommandBar
Set oCommandBar = oapp.UserInterfaceManager.CommandBars.Add("copia0", "copia00ToolbarIntName", , "{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}")
'add the buttons to the toolbar
oCommandBar.Controls.AddButton oButtonDef
'make the toolbar visible
oCommandBar.Visible = True
End If
End Sub
Private Property Get ApplicationAddInServer_Automation() As Object
Set ApplicationAddInServer_Automation = Nothing
End Property
Private Sub ApplicationAddInServer_Deactivate()
If Form1.Visible = True Then
Unload Form1
End If
oButtonDef.Delete
Set oButtonDef = Nothing
Set oapp = Nothing
End Sub
Private Sub ApplicationAddInServer_ExecuteCommand(ByVal CommandID As Long)
End Sub
Private Sub oButtonDef_OnExecute(ByVal Context As Inventor.NameValueMap)
Form1.Show
End Sub
Then i have made the regsvr32 command
and i add the following to the registry:
REGEDIT4
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}]
@="Clona assemblys"
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Description]
@="Clona e renomeia Assemblys"
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Implemented Categories\{39AD2B5C-7A29-11D6-8E0A-0010B541CAA8}]
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Required Categories]
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Required Categories\{39AD2B5C-7A29-11D6-8E0A-0010B541CAA8}]
[HKEY_CLASSES_ROOT\CLSID\{040B2B94-42B9-4089-ADF4-84A67BBB9E9D}\Settings]
"LoadOnStartUp"="1"
"Type"="Standard"
"SupportedSoftwareVersionGreaterThan"="9.."
When i go to tools->add-ins in the add-in manager the load behavior is startup/unloaded, i try to make load in the add-in manager, but this is not working too.
Then i go to tools->customize->commands->add-ins and the icon was not loaded.
Can someone help me to understand what is wrong here?
Thanks.