This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
quacka  
#1 Posted : Friday, July 28, 2006 1:39:45 AM(UTC)
quacka

Rank: Member

Groups: Guest
Joined: 1/17/2005(UTC)
Posts: 32

Hi,

I have the following code to copy one thumbnail object to another and it doesn't seem to work. what am I doing wrong?

Code:
    Private Sub AddFileToFilesList(ByVal filename As String)
        Dim filePidls(0) As Aurigma.GraphicsMill.WinControls.Pidl
        filePidls(0) = Aurigma.GraphicsMill.WinControls.Pidl.Create(filename)

        Dim listItems As Aurigma.GraphicsMill.WinControls.ThumbnailListItem() = Aurigma.GraphicsMill.WinControls.ThumbnailListItem.Create(filePidls)
        ThumbnailListView1.Items.Add(listItems)
    End Sub

    Private Sub AddFileToQueue(ByVal Listitem As ThumbnailListItem)
        ThumbnailListView2.Items.Add(Listitem)
    End Sub

    Private Sub UFlatButton7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UFlatButton7.Click
        If Not ThumbnailListView1.SelectedItems Is Nothing Then
            For Each item As ThumbnailListItem In ThumbnailListView1.SelectedItems
                ThumbnailListView2.Items.Add(item.Clone)
            Next
        End If
    End Sub

Edited by user Wednesday, December 19, 2007 3:34:27 PM(UTC)  | Reason: Not specified

Alex Kon  
#2 Posted : Friday, July 28, 2006 8:22:51 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Guest
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hello,

It is very strange, the code you have posted works correctly in my sample. Could you provide us with more information regarding to error? Which behaviour have you got? Are thumbnails not showing or they haven't copied at all? Could you send us sample project for debugging.
quacka  
#3 Posted : Friday, July 28, 2006 10:04:07 PM(UTC)
quacka

Rank: Member

Groups: Guest
Joined: 1/17/2005(UTC)
Posts: 32

It works but I get thsi error
Code:
System.InvalidOperationException was unhandled
  Message="Cross-thread operation not valid: Control 'ThumbnailListView2' accessed from a thread other than the thread it was created on."
  Source="System.Windows.Forms"
  StackTrace:
       at System.Windows.Forms.Control.get_Handle()
       at Aurigma.GraphicsMill.WinControls.VirtualListView.GetItemRect(Int32 itemIndex)
       at Aurigma.GraphicsMill.WinControls.VirtualListView.UpdateColumnWidth(Int32 itemIndex)
       at Aurigma.GraphicsMill.WinControls.VirtualListView.TextChanged(Object sender, TextChangedEventArgs args)
       at Aurigma.GraphicsMill.WinControls.ListItemCollection.FireTextChanged(IListItem item, Int32 textInfoId)
       at Aurigma.GraphicsMill.WinControls.ListItemCollection.TextChangedInternal(Object sender, TextChangedEventArgs e)
       at Aurigma.GraphicsMill.WinControls.ListItem.FireTextChanged(Int32 textInfoId)
       at Aurigma.GraphicsMill.WinControls.ThumbnailListItem.FireEvalMethod0Events()
       at Aurigma.GraphicsMill.WinControls.ThumbnailListItem.EvaluateMethod(Int32 methodIndex)
       at Aurigma.GraphicsMill.WinControls.Queue.EvaluateQueue()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

Edited by user Wednesday, December 19, 2007 3:34:52 PM(UTC)  | Reason: Not specified

quacka  
#4 Posted : Friday, July 28, 2006 10:15:44 PM(UTC)
quacka

Rank: Member

Groups: Guest
Joined: 1/17/2005(UTC)
Posts: 32

I got it working. Its something to do with VS2005.
I had to do
Code:
    Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Control.CheckForIllegalCrossThreadCalls = False
    End Sub


Is there anyway to make it so what ever i Add is not already inside there already?
basically dont allow duplicate.

Edited by user Wednesday, December 19, 2007 3:35:10 PM(UTC)  | Reason: Not specified

Alex Kon  
#5 Posted : Sunday, July 30, 2006 1:14:53 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Guest
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hello,

Thank you for the solution with VS2005 you have described. As for the question - could you give more detailed description of the problem? Unfortunatelly I have not understood you.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.