473,657 Members | 2,405 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 7466
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*****@discus sions.microsoft .comwrote in message
news:31******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .comwrote in message
news:31******** *************** ***********@mic rosoft.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
4086
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 the "EventLog" object in the "System.Diagnostics" namespace. When a certain event occurrs, both a WMI event is raised, and an event log entry is written. The problem I have is that I need to capture both events and somehow correlate which WMI...
1
4669
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, if you set this ActionCode to various values the control will respond in various ways (reject, reject change field, accept, etc). I am trying to understand exactly how that works as I am trying to extend the control and add more processing s...
1
1217
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. i set to null in code but that doesn't kill process. 2) how do handle events in outlook and potentially word. need to create a custom event for when the outlook email message closes either by send email or user closing form. thanks.
1
1168
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 same machine, only the first application is handling the events raised by my class library. It seems that the other clients on the same machine are not handling the events. What could be the problem and How can we solve this problem.
0
1085
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 example DoubleClick
4
2846
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 when data in A is updated. I know cutom events in wxpython may work. But I found no material paricularly helpful :(
1
2226
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 functionality for this, it is constrained to a Windows environment. Is there a C# that I can use to access the same (events, active process statistics etc) for Linux ?. If not , is there any other programming language/API that I can use for...
1
1924
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 process statistics etc) for Windows as well as Linux platforms ?. If not , is there any other programming language/API that I can use for this ? Regards Jacob
0
8420
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
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
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
8516
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
8617
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
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
6176
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...
1
2743
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 we have to send another system
2
1970
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.