Posted: Fri May 04, 2007 11:41 pm
Awsome!!
The Music Manager for Serious Collectors
http://mediamonkey.com/forum/
Steegy wrote:Then maybe the error is caused because you have an old version of the ActiveX control installed.
It's probably also said in the automatic mail you got, how to download the necessary file (ActiveX control) e.g. from Microsoft's site. Try to update your current version with the newest version. You can also get the necessary file (Microsoft Windows Common Controls 5.0 (SP2)) from here: http://www.mediamonkey.com/wiki/index.p ... t_Controls
This is just a guess. Please ask if it isn't clear, then I'll explain better.
, was you ever able to stop this error?, as I am getting the same thing now.theta_wave wrote:Hi, I'm still receiving that line 192 error after using the hotfixes from the email. I'm using v2.55.998. Here's the screenshot of the error..
El Cabrito wrote:for anyone having the same problem i was having in the last post, the fix is pretty simple. download the comctl32.cab from the link and save it wherever. open it and extract the two files *.inf and *.ocx to the window/system folder. then run -> regsvr32 comctl32
should be good.
only need that if you are missing the comctl32 activeX files
This fixed my problem. Thank you.El Cabrito wrote:for anyone having the same problem i was having in the last post, the fix is pretty simple. download the comctl32.cab from the link and save it wherever. open it and extract the two files *.inf and *.ocx to the window/system folder. then run -> regsvr32 comctl32
should be good.
only need that if you are missing the comctl32 activeX files

Code: Select all
'*****************************************************
'**** GLOBAL DECLARATIONS ****
'*****************************************************
Option Explicit
'Dim LV : Set LV = CreateObject("COMCTL.ListViewCtrl") 'Only necessary for help functions
Const ForegroundColor = &H000000
Const BackgroundColor = &HEFEFEF
Dim TreeNode, ViewMenuItem, Panel
Dim lvAlbums
Dim PreviousAlbumsItem
Dim LastSelection
' ListView Constants
Const lvwReport = 3 'Show listview in "Report" view
Const lvwAutomatic = 0 'Only allow Automatic editing of labels (don't allow manual editing)
' Alignment constants (alignment of the control in its parent control)
Const alNone = 0 'No alignment is applied
Const alTop = 1 'Control is aligned to the top
Const alBottom = 2 'Control is aligned to the bottom
Const alLeft = 3 'Control is aligned to the left
Const alRight = 4 'Control is aligned to the right
Const alClient = 5 'Control completely covers its parent
' Anchors constants (control to which borders of the parent control the control is sticked)
Const akLeft = 1 'Distance from the left border of the parent is constant
Const akTop = 2 'Distance from the top border of the parent is constant
Const akRight = 4 'Distance from the right border of the parent is constant
Const akBottom = 8 'Distance from the bottom border of the parent is constant
'*****************************************************
'**** ENTRY POINT ****
'*****************************************************
Sub OnStartup
Set PreviousAlbumsItem = Nothing
LastSelection = " "
Call Initialise_LicenseFix
Call Initialise_TreeNode
Call Initialise_Panel 'Create the Panel before creating the ViewMenuItem (the ViewMenuItem Checked state depends on the Panel's Visible state)
Call Initialise_ViewMenuItem
Call Initialise_lvAlbums
Call OnPanelResize(Panel)
If SDB.IniFile.StringValue("AlbumsPanes", "PanelVisible") = "False" Then
Panel.Common.Visible = False
Else
Panel.Common.Visible = True
End If
Script.RegisterEvent Panel.Common, "OnResize", "OnPanelResize"
Script.RegisterEvent SDB, "OnChangedSelection", "OnChangedSelection"
Call FillAlbums
End Sub
'*****************************************************
'**** INITIALISATION METHODS ****
'*****************************************************
Sub Initialise_LicenseFix
End Sub
Sub Initialise_TreeNode
Set TreeNode = SDB.MainTree.CreateNode
Set SDB.Objects("AlbumsPanes_TreeNode") = TreeNode
TreeNode.Caption = "Albums Panes"
TreeNode.IconIndex = 46
SDB.MainTree.AddNode SDB.MainTree.Node_MyComputer, TreeNode, 1
Script.RegisterEvent TreeNode, "OnFillTracks", "OnFillTracks"
End Sub
Sub Initialise_Panel
Set Panel = SDB.UI.NewDockablePersistentPanel("AlbumsPanes_Panel")
Set SDB.Objects("AlbumsPanes_Panel") = Panel
If Panel.IsNew Then
Panel.DockedTo = 2
Panel.Common.Width = 430
Panel.Common.Height = 30
End If
Panel.Caption = "AlbumsPanes"
Script.RegisterEvent Panel, "OnClose", "OnPanelClose"
End Sub
Sub Initialise_ViewMenuItem
Set ViewMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_View, 1, -3)
ViewMenuItem.Caption = "Show Albums Panes"
ViewMenuItem.Checked = Panel.Common.Visible
ViewMenuItem.Hint = "Show the extra albums panes"
Script.RegisterEvent ViewMenuItem, "OnClick", "MIClick"
End Sub
Sub Initialise_lvAlbums
Dim objColumnHeader
' Set lvAlbums = SDB.UI.NewActiveX(Panel, "COMCTL.ListViewCtrl")
Set lvAlbums = SDB.UI.NewActiveX(Panel, "MSComctlLib.ListViewCtrl.2")
lvAlbums.Common.Top = 2
lvAlbums.Common.Width = Panel.Common.ClientWidth
lvAlbums.Common.Height = Panel.Common.ClientHeight - 2
lvAlbums.Common.Anchors = akLeft + akRight + akTop + akBottom
lvAlbums.Interf.View = lvwReport
lvAlbums.Interf.LabelEdit = lvwAutomatic
lvAlbums.Interf.HideSelection = False
lvAlbums.Interf.HideColumnHeaders = False
lvAlbums.Interf.FullRowSelect = True
lvAlbums.Interf.GridLines = True
lvAlbums.Interf.AllowColumnReorder = True
lvAlbums.Interf.BackColor = BackgroundColor
lvAlbums.Interf.ForeColor = ForegroundColor
lvAlbums.Interf.ColumnHeaders.Clear
Set objColumnHeader = lvAlbums.Interf.ColumnHeaders.Add()
objColumnHeader.Text = "Artist"
objColumnHeader.Width = lvAlbums.Common.Width * 0.35
Set objColumnHeader = lvAlbums.Interf.ColumnHeaders.Add()
objColumnHeader.Text = "Album"
objColumnHeader.Width = lvAlbums.Common.Width * 0.40
Set objColumnHeader = lvAlbums.Interf.ColumnHeaders.Add()
objColumnHeader.Text = "Songs"
objColumnHeader.Width = lvAlbums.Common.Width * 0.10
Set objColumnHeader = lvAlbums.Interf.ColumnHeaders.Add()
objColumnHeader.Text = "Last Played"
objColumnHeader.Width = lvAlbums.Common.Width * 0.15
' Call lvAlbums.Interf.ColumnHeaders.Add(, , "Albums", lvAlbums.Common.Width)
Script.RegisterEvent lvAlbums.Interf, "ItemClick", "OnAlbumSelect"
End Sub
Sub FillAlbums()
Dim RecordCount
Call lvAlbums.Interf.ListItems.Clear
Call SDB.ProcessMessages
Call lvAlbums.Interf.ListItems.Add( , , "<< All >>")
lvAlbums.Interf.ListItems(1).Selected = True
RecordCount = AddItemsFromQuery(lvAlbums, "" _
+ "SELECT Albums.Album, Albums.ID, Artists.Artist, " _
+ "(Select Count(*) From Songs where Songs.IDAlbum = Albums.ID)," _
+ "(Select max(LastTimePlayed) from Songs where Songs.IDAlbum = Albums.ID) " _
+ " FROM Albums INNER JOIN Artists On Albums.IDArtist = Artists.ID ORDER BY Artists.Artist, Albums.Album ")
lvAlbums.Interf.ListItems(1).Text = "<< All (" & RecordCount & ") >>"
lvAlbums.Interf.ListItems(1).Tag = "ALL"
Set PreviousAlbumsItem = lvAlbums.Interf.SelectedItem
Call SDB.ProcessMessages
Call DoAlbums
End Sub
'*****************************************************
'**** EVENT HANDLING METHODS ****
'*****************************************************
Sub MIClick(ViewMenuItem)
ViewMenuItem.Checked = Not ViewMenuItem.Checked
Panel.Common.Visible = ViewMenuItem.Checked
SDB.IniFile.StringValue("AlbumsPanes", "PanelVisible") = ViewMenuItem.Checked
End Sub
Sub OnPanelClose(Panel)
ViewMenuItem.Checked = False
SDB.IniFile.StringValue("AlbumsPanes", "PanelVisible") = "False"
End Sub
Sub OnFillTracks(TreeNode)
Call SDB.ProcessMessages
If Not Panel.Common.Visible Then
Panel.Common.Visible = True
ViewMenuItem.Checked = True
SDB.IniFile.StringValue("AlbumsPanes", "PanelVisible") = "True"
End If
Call DoAlbums
End Sub
Sub OnAlbumSelect(ListItem)
Call SDB.ProcessMessages
If EqualNodes(SDB.MainTree.CurrentNode, TreeNode) Then
If Not PreviousAlbumsItem Is Nothing Then
If lvAlbums.Interf.SelectedItem.Tag = PreviousAlbumsItem.Tag Then Exit Sub
End If
LastSelection = "Albums"
Call SDB.MainTracksWindow.Refresh
Else
LastSelection = "Albums"
Set SDB.MainTree.CurrentNode = TreeNode
End If
End Sub
Sub OnPanelResize(Panel)
If Panel.DockedTo = 0 Then Exit Sub ' Don't do anything when the panel is being (un)docked
End Sub
Sub OnChangedSelection
If Not EqualNodes(SDB.MainTree.CurrentNode, TreeNode) Then
Call DeselectListViews
End If
End Sub
'*****************************************************
'**** WORKER METHODS ****
'*****************************************************
' called when album is selected
Sub DoAlbums
If lvAlbums.Interf.SelectedItem Is Nothing Then Exit Sub
Call SDB.ProcessMessages
If AlbumsTag = "ALL" Then
Call SDB.MainTracksWindow.AddTracksFromQuery("")
Else
Call SDB.MainTracksWindow.AddTracksFromQuery(" AND Albums.ID=" + AlbumsTag)
End If
Set PreviousAlbumsItem = lvAlbums.Interf.SelectedItem
Call SDB.ProcessMessages
LastSelection = " "
End Sub
Function AlbumsTag
AlbumsTag = lvAlbums.Interf.SelectedItem.Tag
End Function
Function AlbumsTextDQ
AlbumsTextDQ = DoubleUpSingleQuotes(lvAlbums.Interf.SelectedItem.Text)
End Function
Function AddItemsFromQuery(ListView, FullQuery)
Dim Artist, Album, ID, item, lastPlayed, songs
AddItemsFromQuery = 0
Dim Iter : Set Iter = SDB.Database.OpenSQL(FullQuery)
Do While Not Iter.EOF
Album = Iter.StringByIndex(0)
ID = Iter.StringByIndex(1)
Artist = Iter.StringByIndex(2)
songs = Iter.StringByIndex(3)
lastPlayed = Iter.StringByIndex(4)
IF Artist = "" Then
Artist = "Unknown"
End If
If Album = "" Then
Album = "Unknown"
End If
If lastPlayed = "12/30/1899" Then
lastPlayed = ""
End If
Set item = listView.Interf.ListItems.Add
item.Text = Artist
item.Tag = ID
' Set sub1 = item.SubItems.Add(1, , Album)
item.Subitems(1) = Album
item.Subitems(2) = songs
item.SubItems(3) = lastPlayed
' Set sub1 = item.SubItems.Add
' sub1.Text = Album
' listView.Interf.ListItems(1).ListSubItems.Add 1, , "row 1 sub 1"
'IF Artist <> "" AND Album <> "" Then
' Call ListView.Interf.ListItems.Add(, , Artist & " - " & Album)
'Else
' Call ListView.Interf.ListItems.Add(, , "<< Empty >>")
'End If
' ListView.Interf.ListItems(AddItemsFromQuery + 2).Tag = ID
Iter.Next
AddItemsFromQuery = AddItemsFromQuery + 1
Loop
End Function
Sub AddTracksFromQueryAdvanced(FullQuery)
Call SDB.MainTracksWindow.AddTracksFromQuery("AND Songs.ID IN (" & FullQuery & ")")
End Sub
Sub DeselectListViews
If Not lvAlbums.Interf.SelectedItem Is Nothing Then
lvAlbums.Interf.SelectedItem.Selected = False
End If
End Sub
'*****************************************************
'**** GENERAL UTILITY METHODS ****
'*****************************************************
Function EqualNodes(Node1, Node2)
EqualNodes = False
If Not Node1 Is Nothing Then
If Not Node2 Is Nothing Then
If Node1.NodeType = Node2.NodeType Then
If Node1.Caption = Node2.Caption Then
EqualNodes = True
End If
End If
End If
End If
End Function
Function Cond(Test, ResultTrue, ResultFalse)
If Test Then
Cond = ResultTrue
Else
Cond = ResultFalse
End If
End Function
Function DoubleUpSingleQuotes(strInput)
DoubleUpSingleQuotes = Replace(strInput, "'", "''")
End Function
Code: Select all
Error #1024 - Microsoft VBScript Compilation Error
Expected statement
7
File: "C"\Program Files\MediaMonkey\Scripts\Auto\LibraryPanes.vbs", Line 827, Column 0

