2006-09-24, 04:50 AM
Help sub.
On 98.8b after a problem was reported to me on my music library. I get this error when a timer I run, grabs some mp3 tracks and trys to add then to the playlist.
The error shows up in my debugger as:
Before 98.8 this was working - I don't know when the behaviour changed.
Some more details. The main class on my plugin (not the task class) is a static. When it starts, it creates a timer to use for updating the music database, and a random (jukebox mode) music queue after a period of inactivity.
When i perform the same action that it's trying to perform (a random queue of music) with the keyboard, it's fine. The only time the problem occurs is when the timer event is fired off, and it tries to create random music from there.
Are there any suggestions you can offer as to what might be the cause/resolution. I'm not too up on multi-threading......
I've just added a stack trace to give a bit more information...
On 98.8b after a problem was reported to me on my music library. I get this error when a timer I run, grabs some mp3 tracks and trys to add then to the playlist.
The error shows up in my debugger as:
Code:
Cross-thread operation not valid: Control 'HomeMenu' accessed from a thread other than the thread it was created on.
Before 98.8 this was working - I don't know when the behaviour changed.
Some more details. The main class on my plugin (not the task class) is a static. When it starts, it creates a timer to use for updating the music database, and a random (jukebox mode) music queue after a period of inactivity.
When i perform the same action that it's trying to perform (a random queue of music) with the keyboard, it's fine. The only time the problem occurs is when the timer event is fired off, and it tries to create random music from there.
Are there any suggestions you can offer as to what might be the cause/resolution. I'm not too up on multi-threading......
I've just added a stack trace to give a bit more information...
Code:
MusicLibrary2: Generating a random playlist of 60 length
MusicLibrary2: Adding tracks to pluginHelper
A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
MusicLibrary2: Error Adding random tracks to playlist
Cross-thread operation not valid: Control 'HomeMenu' accessed from a thread other than the thread it was created on.
at System.Windows.Forms.Control.get_Handle()
at NativeUtilities.MediaHelper.playMusicFile(String filename, Form form)
at GBPVR.x62b73fb0db4f3947.x826e5d374a1e5ab9(String x8b449efd64797843, Boolean x859a785ef30c9007, Boolean xe1ea8da9364d6bfb)
at GBPVR.x62b73fb0db4f3947.x826e5d374a1e5ab9(String x8b449efd64797843)
at GBPVR.x62b73fb0db4f3947.x313dba8d86564907(Queue x67c4bec203dc37ec)
at GBPVR.xbb1566157f5f8b1f.AddAudioFileToQueue(String file)
at MusicLibrary.MediaLibrary.RandomPlaylist(String primary, String secondary, Int32 minutes) in D:\Documents and Settings\David\My Documents\Visual Studio Projects\GBPVR\C#\MusicLibrary2\MediaLibrary.cs:line 3083