View Issue Details

IDProjectCategoryView StatusLast Update
0014888MMW v4Framework: Scripts/Extensionspublic2018-08-27 14:23
Reporterzvezdan Assigned To 
PrioritynoneSeverityminorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version4.1.22 
Summary0014888: AV error on (GroupBox|Panel).Common.DestroyControl
DescriptionCommon.DestroyControl always causes AV error when it is applied to GroupBox or Panel controls. The test script use modal form, but the AV error happens with modeless forms when applying DestroyControl in OnClose event as well.
Steps To Reproduce1. install test script;
2. choose DestroyControl test in File menu;
3. click DestroyControl button;
4. click Close button -> AV error.

Option Explicit

Dim grpTest
Dim chkTest

Sub OnStartUp()
    Dim oMenuItem

    Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_File, 0, 0)
    oMenuItem.Caption = "DestroyControl test"
    oMenuItem.OnClickFunc = "Test"
    oMenuItem.UseScript = Script.ScriptPath
End Sub

Sub Test(oMenuItem)
    Dim oForm
    Dim btnClose
    Dim btnDo

    Set oForm = SDB.UI.NewForm
    oForm.Common.SetRect 100, 100, 350, 130
    oForm.BorderStyle = 3
    oForm.FormPosition = 4
    oForm.Caption = oMenuItem.Caption

    Set grpTest = SDB.UI.NewGroupBox(oForm)
' Set grpTest = SDB.UI.NewPanel(oForm)
    grpTest.Common.SetRect 10, 10, 300, 40

' Set chkTest = SDB.UI.NewCheckBox(grpTest)
' chkTest.Common.SetRect 10, 10, 300, 20
' chkTest.Caption = "Chk test"

    Set btnDo = SDB.UI.NewButton(oForm)
    btnDo.Caption = SDB.Localize("&DestroyControl")
    btnDo.Common.SetRect 120, 60, 90, 25
    Script.RegisterEvent btnDo, "OnClick", "btnDo_OnClick"

    Set btnClose = SDB.UI.NewButton(oForm)
    btnClose.Caption = SDB.Localize("&Close")
    btnClose.Common.SetRect 220, 60, 90, 25
    btnClose.Cancel = True
    btnClose.ModalResult = 2

    oForm.showModal
End Sub

Sub btnDo_OnClick()
    grpTest.Common.DestroyControl
End Sub
TagsNo tags attached.
Fixed in build1876

Activities

Ludek

2018-07-09 20:18

developer   ~0050731

Fixed in 4.1.22.1876

peke

2018-08-27 14:23

developer   ~0050991

Verified 1876