473,503 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Events between processes

C#, .NET 2.0

Hi,

I have two processes and I need that one process will notify the other.

I could use the EventWaitHandle object and create an (named) event, but this
doesn't allow me to pass any parameters.
I think that:

delegate DelegateName;
event DelegateName MyEventObject;

object is not suitable for interprocess communication. Or am I wrong? If
yes, how could an object in one process subscribe to an event in another
process?

All I need it is to notify another process that something happend and pass
to him a simple parameter, like a short string.

Thanks,

Lubomir
Apr 19 '07 #1
3 7451
Lubomir wrote:
I have two processes and I need that one process will notify the other.

I could use the EventWaitHandle object and create an (named) event, but this
doesn't allow me to pass any parameters.

I think that:

delegate DelegateName;
event DelegateName MyEventObject;

object is not suitable for interprocess communication. Or am I wrong? If
yes, how could an object in one process subscribe to an event in another
process?
No, you're not wrong, because CLR processes don't share memory.
All I need it is to notify another process that something happend and pass
to him a simple parameter, like a short string.
Some candidates:

* WM_COPYDATA - requires using unsafe code, P/Invoke functions,
understanding Win32 API.

* TCP/IP - very simple but somewhat heavyweight, requires understanding
basics of .NET networking (not too difficult). Is portable (.NET not
required on other end) and scalable (apps could be on different
machines)

* .NET remoting - I've never used it, but I understand that it can do
this, and the underlying transport is flexible, but the other app
needs to be .NET too of course.

* Shared memory and event - this is using your named event, but also
adding the capability to share data, using some memory that is mapped
into both processes. Requires unsafe code, P/Invoke functions, more
intimate understanding of Win32 API.

* Other schemes:
- pipes (Win32 API etc. again),
- MSMQ (external service needs to be running; slightly awkward to
configure),
- drop file whose access is synchronized with named event and mutex,
like shared memory without the shared memory

If I were you, I'd go the remoting or TCP route. If you're not familiar
with either remoting or network programming, I think you'll learn more
useful info doing it with TCP than you would with remoting.

-- Barry

--
http://barrkel.blogspot.com/
Apr 19 '07 #2
TCP/IP socket will be a good candidate.

Eric

"Lubomir" <Lu*****@discussions.microsoft.comwrote in message
news:31**********************************@microsof t.com...
C#, .NET 2.0

Hi,

I have two processes and I need that one process will notify the other.

I could use the EventWaitHandle object and create an (named) event, but
this
doesn't allow me to pass any parameters.
I think that:

delegate DelegateName;
event DelegateName MyEventObject;

object is not suitable for interprocess communication. Or am I wrong? If
yes, how could an object in one process subscribe to an event in another
process?

All I need it is to notify another process that something happend and pass
to him a simple parameter, like a short string.

Thanks,

Lubomir
Apr 20 '07 #3
Thanks for help.

Lubomir

"Eric" wrote:
TCP/IP socket will be a good candidate.

Eric

"Lubomir" <Lu*****@discussions.microsoft.comwrote in message
news:31**********************************@microsof t.com...
C#, .NET 2.0

Hi,

I have two processes and I need that one process will notify the other.

I could use the EventWaitHandle object and create an (named) event, but
this
doesn't allow me to pass any parameters.
I think that:

delegate DelegateName;
event DelegateName MyEventObject;

object is not suitable for interprocess communication. Or am I wrong? If
yes, how could an object in one process subscribe to an event in another
process?

All I need it is to notify another process that something happend and pass
to him a simple parameter, like a short string.

Thanks,

Lubomir

Apr 20 '07 #4

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

Similar topics

4
4078
by: Bardo | last post by:
Hi, I have a situation where I am capturing both a WMI event utilising the "ManagementEventWatcher" in the "System.Management" namespace, and a corresponding event ("EntryWritten") raised from...
1
4629
by: Jack Addington | last post by:
I have a 3rd party object that fires an itemchanged event when someone edits some data on a form. This event has a custom eventArgs that has a field called ActionCode. In the code of the event,...
1
1211
by: Devhead | last post by:
1) want to kill my automation server processes when i'm done with them. i.e., want to make sure that my word and outlook processes that are displayed in task manager are disposed of when i'm done....
1
1164
by: Naveen Mukkelli | last post by:
Hi, I'm developing an class library. One of the classes raises some events. I'm testing this library by developing a test application. When I run two instances of this test application on the...
0
1074
by: Jeffrey | last post by:
hello, does somebody know how ho to catch GUI events from other processes? GUI events like these 3 for example DoubleClick Move Resize .....
0
254
by: jeffrey_murdock | last post by:
hello mr./ms. C# guru, does somebody know how ho to catch "GUI events" from "other processes"? I'm only interessted in events which are related to the GUI. -GUI events like these 4 for...
4
2838
by: Jimmy | last post by:
hi, all I'm having a problem with creating custom events in wxpython. I have a class A handling some data processing work and another class B of GUI matter. I need GUI to display information...
1
2218
by: inlovewithmusic | last post by:
Hi, I am writing an application to monitor Operating system events, processes and services that are running on an OS etc. Now , C# has the really cool library System.Diagnostics which provides the...
1
1913
by: inlovewithmusic | last post by:
Hi, I am writing an application to monitor Operating system events, processes and services that are running on an OS etc. Is there a JAVA library that I can use to access the same (events, active...
0
7204
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
7282
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
7342
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...
1
6998
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
5586
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
5018
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
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
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 ...
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.