View Issue Details

IDProjectCategoryView StatusLast Update
0007991MMW v4Framework: Scripts/Extensionspublic2012-09-28 16:33
Reporterzvezdan Assigned To 
PriorityurgentSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version4.0 
Target Version4.0.7Fixed in Version4.0.7 
Summary0007991: Error -2147418113 with oNode = SDB.MainTree.ParentNode(oNode) in OnNodeDragDrop [MM4]
DescriptionThat line works fine in MM3, but not in MM4 (tested 1344, 1392, 1394). If you want to reproduce, install the Magic Nodes script, expand "Genre, Artist, Album, Dics #" node from the "Magic Nodes" folder and try to drag & drop some track to some genre's node.

By the way, the oNode definitely has the parent node; in the previous example it is "Genre, Artist, Album, Dics #".
Additional InformationIf you want cleaner OnNodeDragDrop event handler code then that in the mentioned script, here it is:

Function CustomDragDrop(destNode, srcNode, SongList, DropType, Test)
    If Test Then
        CustomDragDrop = 2
    Else
        Dim oTargetNode
        Set oTargetNode = destNode
        Set oTargetNode = SDB.MainTree.ParentNode(oTargetNode)
    End If
End Function
TagsNo tags attached.
Fixed in build1504

Activities

jiri

2011-06-22 18:58

administrator   ~0026287

Petr, please review, looks like it should be fixed for 4.0.

petr

2011-06-22 20:45

developer   ~0026291

Fixed in 1395

zvezdan

2011-06-23 05:44

updater   ~0026308

Verified in 1395. Thanks.

zvezdan

2012-09-23 21:02

updater   ~0032135

I am sorry but it seems that this bug is not resolved completely. After some user reported it again, I tried several older MM versions and I find out that it is not manifested in Magic Nodes until MM 4.0.6.1501. However, I wrote one test script and I am getting the mentioned error with all MM 4.x versions, even with b1395 (tested 1395, 1422, 1459, 1470 and 1501). Here is the script:

Option Explicit

Sub OnStartUp()
    Dim oParentNode
    Dim oChildNode

    Set oParentNode = SDB.MainTree.CreateNode
    oParentNode.Caption = "Expand this node"
    oParentNode.HasChildren = True
    SDB.MainTree.AddNode SDB.MainTree.Node_Library, oParentNode, 1

    Set oChildNode = SDB.MainTree.CreateNode
    oChildNode.Caption = "Drop some track to this node"
    oChildNode.UseScript = Script.ScriptPath
    oChildNode.OnDragDrop = "OnDragDrop"
    SDB.MainTree.AddNode oParentNode, oChildNode, 3

    SDB.ProcessMessages
    oParentNode.Expanded = True
End Sub

Function OnDragDrop(oDestNode, oSrcNode, oSongList, iCopyType, bJustTest)
    Dim oTargetNode

    If bJustTest Then
        OnDragDrop = 2
    Else
        Set oTargetNode = oDestNode
        Set oTargetNode = SDB.MainTree.ParentNode(oTargetNode)
        If Not oTargetNode Is Nothing Then
            SDB.MessageBox oTargetNode.Caption, mtInformation, Array(mbOK)
        End If
    End If
End Function

By the way, there is a problem with the Expanded property, but I will report that as another issue since it is unrelated to this one.

Ludek

2012-09-26 15:23

developer   ~0032200

Fixed in build 4.0.7.1504

zvezdan

2012-09-28 16:33

updater   ~0032226

It seems that works fine with 1504. Thanks.