View Issue Details

IDProjectCategoryView StatusLast Update
0011496MMW v4Framework: Scripts/Extensionspublic2014-06-06 02:01
Reporterzvezdan Assigned To 
PriorityurgentSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version4.1.2 
Target Version4.1.2 
Summary0011496: Error -2147418113 - Abstract Error - when adding button to custom toolbar
DescriptionIf custom toolbar is created during start-up, but none button is immediately added to it, when I try to add some button later I get the mentioned error dialog box. Here is the test script:

Option Explicit

Sub OnStartUp()
    Dim oMenuItem

    Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    oMenuItem.Caption = "Add toolbar button"
    oMenuItem.OnClickFunc = "Test"
    oMenuItem.UseScript = Script.ScriptPath

    Set SDB.Objects("MyToolbar") = SDB.UI.AddToolbar("Test Toolbar")
End Sub

Sub Test(oMenuItem)
    Set SDB.Objects("tbrTest2") = SDB.UI.AddMenuItem(SDB.Objects("MyToolbar"), 0, 0)
    SDB.Objects("tbrTest2").Caption = "Test2"
End Sub


However, if some button is added to the toolbar during start-up, then I could add new button to it later without any problem:

Option Explicit

Sub OnStartUp()
    Dim oMenuItem

    Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    oMenuItem.Caption = "Add toolbar button"
    oMenuItem.OnClickFunc = "Test"
    oMenuItem.UseScript = Script.ScriptPath

    Set SDB.Objects("MyToolbar") = SDB.UI.AddToolbar("Test Toolbar")
    Set SDB.Objects("tbrTest1") = SDB.UI.AddMenuItem(SDB.Objects("MyToolbar"), 0, 0)
    SDB.Objects("tbrTest1").Caption = "Test1"
End Sub

Sub Test(oMenuItem)
    Set SDB.Objects("tbrTest2") = SDB.UI.AddMenuItem(SDB.Objects("MyToolbar"), 0, 0)
    SDB.Objects("tbrTest2").Caption = "Test2"
End Sub
TagsNo tags attached.
Fixed in build

Relationships

related to 0012074 assignedLudek Cannot hide a button on custom toolbar permanently 

Activities

peke

2014-06-06 02:01

developer   ~0040268

Assigned to Ludek for possible quick fix.