In my app I am loading users that are online for the web app in other sessions… Along with the user, their picture is displayed. Loading their information is going fine but I am having a problem loading up the location of their image and loading it to a web picture so it can display in the listbox. However, I am getting an illegal cast error. Can anybody help with what I am doing wrong? BTW p is a WebPicture. Here is my code:
If sUsersOnline_Usernames.Ubound > -1 Then For i As Integer = 0 To sUsersOnline_Usernames.Ubound fPictureFolder = GetFolderItem(sUsersOnline_PicturePath(i)) If fPictureFolder <> Nil Then If fPictureFolder.Exists And fPictureFolder.IsFolder Then fPictureFile = fPictureFolder.Child(sUsersOnline_PictureName(i)) End If End If If fPictureFile <> Nil Then If fPictureFile.Exists Then p = WebPicture(fPictureFile) Else p = NoUserImage50 End If Else p = NoUserImage50 End If s=sUsersOnline_Usernames(i) + ", " + EndOfLine s=s+sUsersOnline_UserTitle(i) + EndOfLine s=s+sUsersOnline_UserSchool(i) ListBox_UsersOnline.AddRow(sUsersOnline_UserRegID(i),"", s) ListBox_UsersOnline.CellPicture(ListBox_UsersOnline.LastIndex, 1) = p Next End If
Thanks in advance for help.