[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2324
  • Last Modified:

DragDrop registration did not succeed

I am using Visual Studio 2005.

In the event handler of a Timer on a form I am setting some of the fields visible. But I get a "DragDrop registration did not succeed" error. This does not happen if I just the fields' enabled property.

Can someone please tell me what I need to do?
0
emdsft
Asked:
emdsft
  • 3
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
What does your form do?

Can you show us the code in the Timer event?
0
 
emdsftAuthor Commented:
Actually its not a timer but an event from a DLL  

   Private Sub Core_Tufter_YarnFeedEnabledChanged(ByVal Index As Integer, ByVal Enabled As Boolean)
        Core.StatusPnlArray(Index).Enabled = Enabled
        Core.SettingsValLblArray(Index).Visible= Enabled             '// This is where I get the error.
        Core.FeedTypeLblArray(Index).Visible= Enabled
        If Not Enabled Then
            Core.StatusPnlArray(Index).BackgroundImage = My.Resources.YarnFeed_Gray
            Core.SettingsValLblArray(Index).Text = ""
            Core.FeedTypeLblArray(Index).Text = ""
        End If
    End Sub

I have set Control.CheckForIllegalCrossThreadCalls = False in Form Load.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Try using a Delegate:

    Private Delegate Sub YarnFeedDelegate(ByVal Index As Integer, ByVal Enabled As Boolean)

    Private Sub Core_Tufter_YarnFeedEnabledChanged(ByVal Index As Integer, ByVal Enabled As Boolean)
        UpdateYarnFeed(Index, Enabled)
    End Sub

    Private Sub UpdateYarnFeed(ByVal Index As Integer, ByVal Enabled As Boolean)
        If Me.InvokeRequired() Then
            Dim yfd As New YarnFeedDelegate(AddressOf Me.UpdateYarnFeed)
            Me.Invoke(yfd, New Object() {Index, Enabled})
        Else
            Core.StatusPnlArray(Index).Enabled = Enabled
            Core.SettingsValLblArray(Index).Visible= Enabled
            Core.FeedTypeLblArray(Index).Visible= Enabled
            If Not Enabled Then
                Core.StatusPnlArray(Index).BackgroundImage = My.Resources.YarnFeed_Gray
                Core.SettingsValLblArray(Index).Text = ""
                Core.FeedTypeLblArray(Index).Text = ""
            End If
        End If
    End Sub
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
In general,

    Control.CheckForIllegalCrossThreadCalls = False

is a BAD idea.  That is why it is True by default.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now