473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Exception handelling in thread

9
hi,

I have created a application in which there is thread for login to server.
If exception occure while connection to server I can not catch that exception.
What can I do.
Please help me.
Feb 19 '08 #1
3 858
Plater
7,872 Expert 4TB
Why can you not catch the error?
Unless it's causing an unmanaged error, you should be able to catch all exceptions.
You can put try/catch blocks in code that runs in its own thread.
Feb 19 '08 #2
vedika
9
hi,
thanks for reply.
i got a solution from this site itself.
if (<control>.InvokeRequired)
{
<control>.Invoke(new <deligate>(<function>), new object[] { <parameter> });

}
Feb 20 '08 #3
Plater
7,872 Expert 4TB
Ahh so your problem was with unsafe thread usage (accessing GUI controls from a thread that did not create them).
Yeah, invoke required goes a long way to handling that
Feb 20 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Noor | last post by:
please tell the technique of centralize exception handling without try catch blocks in c#.
28
by: dcrespo | last post by:
Hi all, How can I get a raised exception from other thread that is in an imported module? For example: --------------- programA.py ---------------
4
by: Bhavya Shah | last post by:
Hello, I am facing a very strange problem in my application. I have a form on which I select a path. I open the FolderBrowserDialog for path selection. Once the path is selected I press a button...
5
by: David | last post by:
I am having a bit of a problem with catching an exception within a thread. Here is the scenario: I have a Windows Form. I create a new thread. This new thread calls a method in another DLL...
4
by: Anders Borum | last post by:
Hello! I am working on improving my threading skills and came across a question. When working with the ReaderWriterLock class, I am getting an unhandled exception if I acquire a WriterLock with...
5
by: Lucvdv | last post by:
Can someone explain why this code pops up a messagebox saying the ThreadAbortException wasn't handled? The first exception is reported only in the debug pane, as expected. The second (caused by...
16
by: Chuck Cobb | last post by:
I'm implementing a centralized exception handling routine using the Enterprise Library Exception Management Application Block. I trap all unhandled exceptions to one place using the following...
2
by: Robinson | last post by:
Hi, I have 2 menu items on the Debug menu of my application: Throw Exception On Form and Throw Exception In Worker Thread The former just executes: throw new Exception ( "I'm testing...
7
by: Brendon Costa | last post by:
Hi all, I have a small python project i am working on. Basically i always have two threads. A "Read" thread that sits in a loop reading a line at a time from some input (Usually stdin) and then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.