473,797 Members | 2,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application.Thr eadException mysteriously solve a problem...

Hello,
in a VB.NET Application I had a problem after a Drag&Drop operation from
Windows Desktop (Dataformats.fi ledrop) to listview....
In debug there are no errors so I've decided to implement the application
ThreadException event (throug addhandler in sub main)
After this the problem was disappeared...
Why?

Thank You
Jul 21 '05 #1
3 1529
What was the problem? Are you using System.Windows. Forms.Clipboard together
with multiple threads?

Regards, Jakob.
"Giovanni pepe" wrote:
Hello,
in a VB.NET Application I had a problem after a Drag&Drop operation from
Windows Desktop (Dataformats.fi ledrop) to listview....
In debug there are no errors so I've decided to implement the application
ThreadException event (throug addhandler in sub main)
After this the problem was disappeared...
Why?

Thank You

Jul 21 '05 #2
This is my code for Drag&Drop :

Lvw_DragDrop:
--------------------------------------------------------------------------
For Each Filename In e.Data.GetData( DataFormats.Fil eDrop)
ReDim Preserve SourceFiles(i)
SourceFiles(i) = CompleteFilenam e
i = i + 1
Next
--------------------------------------------------------------------------

Lvw_DragEnter:
------------------------------------------------------------------------
If (e.Data.GetData Present(DataFor mats.FileDrop, False)) Then
e.Effect = DragDropEffects .Copy
End If
------------------------------------------------------------------------

This code generate an error ...
The error is disappear when i insert into code Application.Thr eadException
Jul 21 '05 #3
I tried the following code which is very similar to yours and it works fine:

Private Sub ListView1_DragD rop(ByVal sender As Object, ByVal e As
System.Windows. Forms.DragEvent Args) Handles ListView1.DragD rop
Dim Filename As String
For Each Filename In e.Data.GetData( DataFormats.Fil eDrop)
Dim item As New ListViewItem
item.Text = Filename
ListView1.Items .Add(item)

Next
End Sub

Private Sub ListView1_DragE nter(ByVal sender As Object, ByVal e As
System.Windows. Forms.DragEvent Args) Handles ListView1.DragE nter
If (e.Data.GetData Present(DataFor mats.FileDrop, False)) Then
e.Effect = DragDropEffects .Copy
End If
End Sub

Are you sure that you are not using threads somewhere? Is your form running
on the main thread of your application? Are you using the MTAThreadAttrib ute
anywhere? Which error is generated by your code?

Regards, Jakob.
"Giovanni pepe" wrote:
This is my code for Drag&Drop :

Lvw_DragDrop:
--------------------------------------------------------------------------
For Each Filename In e.Data.GetData( DataFormats.Fil eDrop)
ReDim Preserve SourceFiles(i)
SourceFiles(i) = CompleteFilenam e
i = i + 1
Next
--------------------------------------------------------------------------

Lvw_DragEnter:
------------------------------------------------------------------------
If (e.Data.GetData Present(DataFor mats.FileDrop, False)) Then
e.Effect = DragDropEffects .Copy
End If
------------------------------------------------------------------------

This code generate an error ...
The error is disappear when i insert into code Application.Thr eadException

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
16976
by: Bill | last post by:
For some reason, I have an errormessage popup that "blinks", but pops up BEHIND the applications, which is confusing to users. Is there any way to force it to the top?
2
1348
by: Mathieu Brüning | last post by:
Hi all, i'm trying to write an exception handler for my application, so in case an exception occurs anywhere in my application, the exception has to be catched. At this moment i'm doing it via the following code: Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
5
1531
by: Jason MacKenzie | last post by:
I have a production critical windows forms application. I have try catch blocks everywhere to handle every eventuality. However occasionally, every couple of months, the application crashes. Its usually a .Net Framework error message telling me there was an unhandled exception An example would be last October when the clocks rolled back. My question is: is there a way to handle an exceptions that might make it through the error...
2
4776
by: Alex | last post by:
My Problem is that although i have added a handler to Application.ThreadException and it works fine for my application exceptions, it does not fire if an exception is generated inside an event handler of my App. eg. If i throw a exception inside DragDrop, or MouseDown of an event the ThreadException does not fire !! Any ideas ???
4
10772
by: rs | last post by:
Hi guys Thank you in advance for the help. I developed a simple application using vs.net 2003. running framework 1.1 sp1. the application runs fine on the development machine (win xp). I tried to deploy it on a win 2000 sp4 framework 1.1 sp1. I got the following error Reminder.exe - Common Language Runtime Debugging Services application has generated an exception that could not be handled
3
233
by: Giovanni pepe | last post by:
Hello, in a VB.NET Application I had a problem after a Drag&Drop operation from Windows Desktop (Dataformats.filedrop) to listview.... In debug there are no errors so I've decided to implement the application ThreadException event (throug addhandler in sub main) After this the problem was disappeared... Why? Thank You
6
1234
by: TPI | last post by:
I wrote application wich i working on IntPtr. Whole thing is using Marshal.ReadInt32 and Marshal.WriteInt32. And sometimes the application shuts down with out any wornings and exceptions. With out worninigs and exceptions I do not know where to look up. I need help with this problem.
7
2600
by: Daniel | last post by:
Hello! I am having a problem with a windows application that abnormally terminates itself. The application is a multi threaded .NET 1.1 application, and can briefly be described as follows: Call the thread running the GUI "A". When user clicks a button a new thread "B" is created and started. "B" does a lots of work, among others transmitts data via a USB-CAN-interface. At the end of "B" a paper label is printed using methods provided...
5
4539
by: Frank Rizzo | last post by:
I have a c# 2.0 winform app that runs under a user account with very limited rights. The application crashes on some actions (the Send Error to Microsoft screen) with unauthorized exception. This is despite the fact that I have try catch blocks around pretty much absolutely everything. I've tried logging to disk, but it seems to crash on a deeper level. The app works fine when run under an admin account. So how can I audit what the...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9536
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10245
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10205
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9063
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7559
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.