problem with Threading
-
G'day folks, I just implemented a winform containing a listview. The listview simply lists all the files present in a directory with the name and its respective icon in one column. As I was trying to get an understanding on how Win32.SHGetFileInfo works. The process of actually adding the information was done via a separate thread. What I had discovered that if one of my files contained an outlook message file, it will not display the icon for outlook instead it displays the generic windows icon. The generic windows icon is the same as when windows os cannot seem to associate an application with a file. Now if I were to display the files and its respective icon in the listview without the assistance of a thread, the outlook icon appears in the listview. So far it works fine with any other file ie. txt, word, excel etc. The samething happens with .net 1.1 and 2.0 Anyone got any ideas as to why this would be happening ? thanks
-
G'day folks, I just implemented a winform containing a listview. The listview simply lists all the files present in a directory with the name and its respective icon in one column. As I was trying to get an understanding on how Win32.SHGetFileInfo works. The process of actually adding the information was done via a separate thread. What I had discovered that if one of my files contained an outlook message file, it will not display the icon for outlook instead it displays the generic windows icon. The generic windows icon is the same as when windows os cannot seem to associate an application with a file. Now if I were to display the files and its respective icon in the listview without the assistance of a thread, the outlook icon appears in the listview. So far it works fine with any other file ie. txt, word, excel etc. The samething happens with .net 1.1 and 2.0 Anyone got any ideas as to why this would be happening ? thanks
Did you use Control.Invoke[^] or BeginInvoke to update the treeview from the other thread? If not, you must use it, this[^] article describes why. Regards Senthil _____________________________ My Blog | My Articles | WinMacro
-
Did you use Control.Invoke[^] or BeginInvoke to update the treeview from the other thread? If not, you must use it, this[^] article describes why. Regards Senthil _____________________________ My Blog | My Articles | WinMacro