473,480 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Raise an event from a DLL to an application

2 New Member
I have a C# solution with 2 projects, a test form in one project and a DLL in another. The DLL connects to a socket and sends and receives messages to and from the test application using properties in the DLL.
How does one send an event, such as poll events of the socket, to the test application? I want to know if the connection was dropped, when it was dropped, and set a button to red when connection is lost.
Very new to C# and I hope I framed the question well enough to get an answer.
Thanks in advance,
Joe
Jan 22 '08 #1
3 3080
Plater
7,872 Recognized Expert Expert
Create an event in your DLL, have it "fire" when the Poll events show that the socket is disconnected (bravo for knowing that Poll() can be used to detect an instant disconnect)
Then have your main program attach an event listener for it.
Jan 23 '08 #2
geezerjoe
2 New Member
Create an event in your DLL, have it "fire" when the Poll events show that the socket is disconnected (bravo for knowing that Poll() can be used to detect an instant disconnect)
Then have your main program attach an event listener for it.
Thank you!
Will I have to poll/raise event in a seperate thread? Is threading even a concern here?
Thank you again, Joe
Jan 23 '08 #3
Plater
7,872 Recognized Expert Expert
If you are already doing the Poll() calls in your DLL, all you need do is fire that event if it ever fails.
Jan 23 '08 #4

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

Similar topics

2
1557
by: (Pete Cresswell) | last post by:
I've been perusing a "real-life" application and notice that for instance, in a button's Click() event, they don't write the processing code. Instead, they raise an event like AddNewRecord and...
1
10490
by: Dan Cimpoiesu | last post by:
I have a remoting object, derived from MarshalByRefComponent, that I instantiate on the client side, with Activator.GetObject. Can I receive events fired on the server, on the client? How?
2
2540
by: ZAky | last post by:
Why do I get a System.NullReferenceException for this script? I added the following script to a simple form with a button. <Script> public event EventHandler DoThis; static void Main() {...
5
2121
by: Mark Overstreet | last post by:
I am writing an app that needs to contain an object model that allows it to be controlled similiar to something like Word. However, I am writing this in C# and all managed code. I know that I can...
0
944
by: Mike | last post by:
I have a asp.net (vb.net) web app that calls a VB.NET class. This class has a raise Event in it. - raised event getStuff I can't call the raised Event getStuff. Can i not call or execute a raised...
2
1955
by: Eric Robinson | last post by:
My application creates a number of objects for monitoring servers. Each object monitors one server. When an object detects certain conditions in the server, it should raise an event to notify the...
2
1590
by: Filipe Marcelino | last post by:
Hi, I'm an experienced vb .net developer in windows forma. Now I'm trying to develop a windows service and I would like to know if it's possible to raise an event from a windows application...
3
2111
by: =?Utf-8?B?Ulc=?= | last post by:
I constructed a new Class with some private members. I would like an event to be raised on the moment the value of one of those private members is changed. How do I define an event for that...
5
1994
by: Mike | last post by:
Hi group; Let say I have an object called Account, that raises an event called AccountLow with its owns EventArgs, and when this event gets raised, I will like to raise another custom...
11
4002
by: nadeem_far | last post by:
Hello, I am working on a c# project using framework 1.1. Since its a console application,no windows forms are being used. I am trying to implement event driven classes that just want to raise...
0
7037
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
6904
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...
0
7032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6873
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...
0
5321
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,...
1
4767
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...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.