MM4: Custom Menu Items on Treenode [#7366 #7699]

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: MM4: Custom Menu Items on Treenode [#7366 #7699]

Re: MM4: Custom Menu Items on Treenode [#7366]

by Ludek » Sat Apr 30, 2011 4:23 pm

Re: MM4: Custom Menu Items on Treenode [#7366]

by Lowlander » Sat Apr 30, 2011 2:59 pm

This should be fixed since 1364, can you confirm?

Re: MM4: Custom Menu Items on Treenode [#7366]

by Melloware » Thu Apr 28, 2011 7:46 am

Yep it fails in both scenarios.

Re: MM4: Custom Menu Items on Treenode [#7366]

by Ludek » Thu Apr 28, 2011 7:35 am

One question, does it fail also if you use something like this:

Code: Select all

SDBApplication MM = this.MediaMonkey;
SDBTree tree = MM.MainTree;
instead of current

Code: Select all

SDBTree tree = this.MediaMonkey.MainTree;
Btw. I added the issue to Mantis as http://www.ventismedia.com/mantis/view.php?id=7699

Re: MM4: Custom Menu Items on Treenode [#7366]

by Melloware » Wed Apr 27, 2011 12:35 pm

Another user has confirmed this. A clean MM4 install on Win 7 64 bit the COM object fails. If they install MM3 then MM4 all works...

http://forum.melloware.com/viewtopic.ph ... 294#p25293

Re: MM4: Custom Menu Items on Treenode [#7366]

by Melloware » Mon Apr 18, 2011 9:00 am

Yes that is what I am doing but what is really interesting is I am using the COM object fine and it only fails when calling the above method. Meaning other SDB calls are working fine so the COM object is there it is just when adding this child node it throws this error. Then when users install MM3 and then MM4 this error is corrected.

It is very strange.

I am actually passing the running COM object into my application through VBS like this.... So I create my COM .NET app and then pass the SDB instance into it. This is the only way in C# to catch the OnPlay, OnStop, events.

Code: Select all

Set monkeytunes = CreateObject("Melloware.MonkeyTunes.MonkeyTunesServer")
monkeytunes.Init(SDB)

Re: MM4: Custom Menu Items on Treenode [#7366]

by Ludek » Mon Apr 18, 2011 8:49 am

Hi,
1FAF02F8-A7D3-41F1-9210-A3B12046F136 is GUID of ISDBApplication interface (same as in MM3) so I don't see a reason why it should fail in MM4.

How did you define MediaMonkey object? Something like this:

'Dim MediaMonkey
'Set MediaMonkey = CreateObject("SongsDB.SDBApplication")
?

You can access it simply via
SDB.MainTree
and it should work

Re: MM4: Custom Menu Items on Treenode [#7366]

by Melloware » Mon Apr 18, 2011 6:55 am

Ludek, It appears to be fixed in the latest .1364 version of MM4 so thank you!

I have a new issue though reported by some users.

http://forum.melloware.com/viewtopic.php?f=16&t=9202

They report that if they don't install MM3 before installing MM4 they get a COM error when I try to add a child treenode. Could it be possibly the COM object for MM4 is missing this certain API call that happens to be in the MM3 COM API? That is why installing 3 before 4 works?

Code: Select all

2011-04-17 16:36:08,726 [ERROR] - (12) - Error filling treenode...
System.InvalidCastException: Unable to cast COM object of type 'SongsDB.SDBApplicationClass' to interface type 'SongsDB.ISDBApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{1FAF02F8-A7D3-41F1-9210-A3B12046F136}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
   at SongsDB.SDBApplicationClass.get_MainTree()
   at Melloware.MonkeyTunes.MonkeyTunesServer.CJynqUKX3h8mBRSYKJY(Object )
   at Melloware.MonkeyTunes.MonkeyTunesServer.Un2KIghXy(SDBTreeNode )
Here is the code where I fill the treenode:

Code: Select all

/// <summary>
        /// Event fired when the MonkeyTunes + is clicked on to expand the treeview.
        /// </summary>
        /// <param name="node">the node to fill the children for</param>
        void MediaMonkey_OnFillChildren(SDBTreeNode node) {
        	try {
        		LOG.Info("MonkeyTunes Filling Treenode");
        		SDBTree tree = this.MediaMonkey.MainTree;

        		// delete all old children
        		node.HasChildren = false;

        		foreach (KeyValuePair<string, NetService> pair in PairingServer.Services) {
        			string deviceName;
        			NetService service = pair.Value;
        			try {
        				byte[] txt = service.TXTRecordData;
        				IDictionary dict = NetService.DictionaryFromTXTRecordData(txt);
        				byte[] value = (byte[])dict["DvNm"];
        				deviceName = Encoding.UTF8.GetString(value);

        			} catch (Exception) {
        				deviceName = "Unknown Device";
        			}
        			LOG.InfoFormat("TreeNode Device Name = {0}", deviceName);
        			SDBTreeNode deviceNode = tree.CreateNode;
        			deviceNode.Caption = deviceName;
        			deviceNode.CustomData = service.Name;
        			deviceNode.IconIndex = 54;
        			deviceNode.OnNodeFocused += new ISDBTreeNodeEvents_OnNodeFocusedEventHandler(MediaMonkey_OnNodeFocused);
        			tree.AddNode(node, deviceNode, EnumTreeNodePos.NodePos_AddChildLast);
        		}
        		node.Expanded = true;
        		LOG.Info("MonkeyTunes Filled Treenode successfully");
        	} catch (Exception ex) {
        		LOG.Error("Error filling treenode...", ex);
        	}
        }

Re: [FIXED] MM4: Custom Menu Items on Treenode

by Peke » Wed Apr 06, 2011 7:33 pm

Re: [FIXED] MM4: Custom Menu Items on Treenode

by Melloware » Wed Apr 06, 2011 3:17 pm

Just sent you a PM....

Re: [FIXED] MM4: Custom Menu Items on Treenode

by Ludek » Wed Apr 06, 2011 3:04 pm

I would like to confirm, but my MonkeyTunes has expired, please PM me if there is a cheat.

Re: [FIXED] MM4: Custom Menu Items on Treenode

by Melloware » Thu Mar 31, 2011 11:29 am

I am using 13557 and I did see my menu options once but now they are gone again.

Re: MM4: Custom Menu Items on Treenode

by Melloware » Mon Mar 21, 2011 7:28 am

Excellent! Thank you for the fix!

Re: MM4: Custom Menu Items on Treenode

by Ludek » Mon Mar 21, 2011 7:19 am

You are right, I actually tested current sources instead of 1355, so it will be fixed in 1356:
Image

Re: MM4: Custom Menu Items on Treenode

by Melloware » Mon Mar 21, 2011 6:54 am

Ludek,

When I install MM4 1355 and run this is what the right click shows for me on the MOnkeyTunes Treenode.

Image

It should show the View Log File..., About MonkeyTunes, etc menu items.

Top