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);
}
}
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.
[url]http://forum.melloware.com/viewtopic.php?f=16&t=9202[/url]
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]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 )[/code]
Here is the code where I fill the treenode:
[code]/// <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);
}
}
[/code]