Connecting Tech Pros Worldwide Help | Site Map

Drag-Drop stops working after one or two days

Qingdong Z.
Guest
 
Posts: n/a
#1: Nov 17 '05
I have a VS.NET windows application which use drag-drop feather. It works
fine when application start, but stops working after application run one or
two days. The application is related to Video process, CPU/Memory extensive.

The drag-drop is in a new windows form. It drags from TreeView Control to
other control in the same form. It cannot trigger ItemDrag event of TreeView
after drag-drop feather die.

Can you give me any idea? Thanks.

Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#2: Nov 17 '05

re: Drag-Drop stops working after one or two days


Qingdong,

Without seeing the code, it is hard to say. Chances are there is some
sort of exception being thrown, but because all of the drag/drop actions are
performed in event handlers, the exception is swallowed.

What you want to do is wrap all of your event handling code related to
drag/drop in try/catch handlers, and see if an exception is thrown. Once
you find out where it is thrown, you can work from there to figure out what
the problem is.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Qingdong Z." <QingdongZ@discussions.microsoft.com> wrote in message
news:C309A747-203F-4C85-BB52-A927B900A7CE@microsoft.com...[color=blue]
>I have a VS.NET windows application which use drag-drop feather. It works
> fine when application start, but stops working after application run one
> or
> two days. The application is related to Video process, CPU/Memory
> extensive.
>
> The drag-drop is in a new windows form. It drags from TreeView Control to
> other control in the same form. It cannot trigger ItemDrag event of
> TreeView
> after drag-drop feather die.
>
> Can you give me any idea? Thanks.
>[/color]


Qingdong Z.
Guest
 
Posts: n/a
#3: Nov 17 '05

re: Drag-Drop stops working after one or two days


Nicholas,

Here is the code:

Private Sub tvMapItems_ItemDrag(ByVal sender As Object, ByVal e As
System.Windows.Forms.ItemDragEventArgs) Handles tvMapItems.ItemDrag
If e.Item.GetType.Name = "FacilityMapNode" Then
DoDragDrop(e.Item, DragDropEffects.Move)
End If
End Sub

Private Sub picMap_DragEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles picMap.DragEnter
e.Effect = DragDropEffects.Move
End Sub

Private Sub picMap_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles picMap.DragDrop
...
End Sub


"Nicholas Paldino [.NET/C# MVP]" wrote:
[color=blue]
> Qingdong,
>
> Without seeing the code, it is hard to say. Chances are there is some
> sort of exception being thrown, but because all of the drag/drop actions are
> performed in event handlers, the exception is swallowed.
>
> What you want to do is wrap all of your event handling code related to
> drag/drop in try/catch handlers, and see if an exception is thrown. Once
> you find out where it is thrown, you can work from there to figure out what
> the problem is.
>
> Hope this helps.
>[/color]
Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#4: Nov 17 '05

re: Drag-Drop stops working after one or two days


That's the thing, without seeing what goes on in picMap_DragDrop, there
is nothing that can be determined.

I think that you should place try/catch blocks in your event handlers,
and log if there are exceptions.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Qingdong Z." <QingdongZ@discussions.microsoft.com> wrote in message
news:BF95D5E1-F0D8-4971-98D1-2D0F3F0D7428@microsoft.com...[color=blue]
> Nicholas,
>
> Here is the code:
>
> Private Sub tvMapItems_ItemDrag(ByVal sender As Object, ByVal e As
> System.Windows.Forms.ItemDragEventArgs) Handles tvMapItems.ItemDrag
> If e.Item.GetType.Name = "FacilityMapNode" Then
> DoDragDrop(e.Item, DragDropEffects.Move)
> End If
> End Sub
>
> Private Sub picMap_DragEnter(ByVal sender As Object, ByVal e As
> System.Windows.Forms.DragEventArgs) Handles picMap.DragEnter
> e.Effect = DragDropEffects.Move
> End Sub
>
> Private Sub picMap_DragDrop(ByVal sender As Object, ByVal e As
> System.Windows.Forms.DragEventArgs) Handles picMap.DragDrop
> ...
> End Sub
>
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>[color=green]
>> Qingdong,
>>
>> Without seeing the code, it is hard to say. Chances are there is
>> some
>> sort of exception being thrown, but because all of the drag/drop actions
>> are
>> performed in event handlers, the exception is swallowed.
>>
>> What you want to do is wrap all of your event handling code related
>> to
>> drag/drop in try/catch handlers, and see if an exception is thrown. Once
>> you find out where it is thrown, you can work from there to figure out
>> what
>> the problem is.
>>
>> Hope this helps.
>>[/color][/color]


Qingdong Z.
Guest
 
Posts: n/a
#5: Nov 17 '05

re: Drag-Drop stops working after one or two days


Nicholas,

I think the drop event is never triggered, because the drag event should
have been fired first. For what ever reason, the tvMapItems_ItemDrag was not
fired, because there is no drag-move effect.

"Nicholas Paldino [.NET/C# MVP]" wrote:
[color=blue]
> That's the thing, without seeing what goes on in picMap_DragDrop, there
> is nothing that can be determined.
>
> I think that you should place try/catch blocks in your event handlers,
> and log if there are exceptions.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
> "Qingdong Z." <QingdongZ@discussions.microsoft.com> wrote in message
> news:BF95D5E1-F0D8-4971-98D1-2D0F3F0D7428@microsoft.com...[color=green]
> > Nicholas,
> >
> > Here is the code:
> >
> > Private Sub tvMapItems_ItemDrag(ByVal sender As Object, ByVal e As
> > System.Windows.Forms.ItemDragEventArgs) Handles tvMapItems.ItemDrag
> > If e.Item.GetType.Name = "FacilityMapNode" Then
> > DoDragDrop(e.Item, DragDropEffects.Move)
> > End If
> > End Sub
> >
> > Private Sub picMap_DragEnter(ByVal sender As Object, ByVal e As
> > System.Windows.Forms.DragEventArgs) Handles picMap.DragEnter
> > e.Effect = DragDropEffects.Move
> > End Sub
> >
> > Private Sub picMap_DragDrop(ByVal sender As Object, ByVal e As
> > System.Windows.Forms.DragEventArgs) Handles picMap.DragDrop
> > ...
> > End Sub
> >
> >
> > "Nicholas Paldino [.NET/C# MVP]" wrote:
> >[color=darkred]
> >> Qingdong,
> >>
> >> Without seeing the code, it is hard to say. Chances are there is
> >> some
> >> sort of exception being thrown, but because all of the drag/drop actions
> >> are
> >> performed in event handlers, the exception is swallowed.
> >>
> >> What you want to do is wrap all of your event handling code related
> >> to
> >> drag/drop in try/catch handlers, and see if an exception is thrown. Once
> >> you find out where it is thrown, you can work from there to figure out
> >> what
> >> the problem is.
> >>
> >> Hope this helps.
> >>[/color][/color]
>
>
>[/color]
Closed Thread