473,395 Members | 1,631 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,395 software developers and data experts.

"Named Event"

Hi all,

I need to write app in C# that communicates with other app. I need to
use "named event" for that.
I should use windows APIs SetEvent() and WaitForSingleObject() etc...
I looked for help but couldn't find any.

Can any one please help me with that?

Thanks.

Jun 3 '07 #1
6 9183
On Jun 3, 11:53 am, alexia....@gmail.com wrote:
Hi all,

I need to write app in C# that communicates with other app. I need to
use "named event" for that.
I should use windows APIs SetEvent() and WaitForSingleObject() etc...
I looked for help but couldn't find any.

Can any one please help me with that?

Thanks.
See this link:
http://www.codeproject.com/csharp/InteropEvents.asp

Jun 3 '07 #2
Look for Mutex class in MSDN help. (more specifically to named mutex.)

- José

<al********@gmail.coma écrit dans le message de news:
11**********************@q75g2000hsh.googlegroups. com...
Hi all,

I need to write app in C# that communicates with other app. I need to
use "named event" for that.
I should use windows APIs SetEvent() and WaitForSingleObject() etc...
I looked for help but couldn't find any.

Can any one please help me with that?

Thanks.

Jun 3 '07 #3
Aneesh,

As of .NET 2.0, you don't need to use interop to get the handle to named
events. You can call the static OpenExisting method to get a reference to
an event which already exists and is named.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Aneesh P" <an******@gmail.comwrote in message
news:11*********************@z28g2000prd.googlegro ups.com...
On Jun 3, 11:53 am, alexia....@gmail.com wrote:
>Hi all,

I need to write app in C# that communicates with other app. I need to
use "named event" for that.
I should use windows APIs SetEvent() and WaitForSingleObject() etc...
I looked for help but couldn't find any.

Can any one please help me with that?

Thanks.
See this link:
http://www.codeproject.com/csharp/InteropEvents.asp
Jun 3 '07 #4
On Jun 3, 4:28 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Aneesh,

As of .NET 2.0, you don't need to use interop to get the handle to named
events. You can call the static OpenExisting method to get a reference to
an event which already exists and is named.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"Aneesh P" <anees...@gmail.comwrote in message

news:11*********************@z28g2000prd.googlegro ups.com...
On Jun 3, 11:53 am, alexia....@gmail.com wrote:
Hi all,
I need to write app in C# that communicates with other app. I need to
use "named event" for that.
I should use windows APIs SetEvent() and WaitForSingleObject() etc...
I looked for help but couldn't find any.
Can any one please help me with that?
Thanks.
See this link:
http://www.codeproject.com/csharp/InteropEvents.asp- Hide quoted text -

- Show quoted text -
Hello Nicholas,

thanks you and the other guys for your reply.

Can I use OpenExisting to sync with events set by app run from kernel
developed by C++?
Also, Is there a .NET way which replaces WIN API DeviceIoControl?

thanks.

Jun 3 '07 #5
Yes, you can use OpenExisting to get a reference to an event that was
created in a C++ program, for example, as long as they used the same
underlying API (CreateEvent, CreateEventEx, which the managed wrappers use)
with the same name.

As for DeviceIOControl, there is not a managed representation. You will
have to call the function through the P/Invoke layer.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<al********@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
On Jun 3, 4:28 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
>Aneesh,

As of .NET 2.0, you don't need to use interop to get the handle to
named
events. You can call the static OpenExisting method to get a reference
to
an event which already exists and is named.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"Aneesh P" <anees...@gmail.comwrote in message

news:11*********************@z28g2000prd.googlegr oups.com...
On Jun 3, 11:53 am, alexia....@gmail.com wrote:
Hi all,
>I need to write app in C# that communicates with other app. I need to
use "named event" for that.
I should use windows APIs SetEvent() and WaitForSingleObject() etc...
I looked for help but couldn't find any.
>Can any one please help me with that?
>Thanks.
See this link:
http://www.codeproject.com/csharp/InteropEvents.asp- Hide quoted text -

- Show quoted text -

Hello Nicholas,

thanks you and the other guys for your reply.

Can I use OpenExisting to sync with events set by app run from kernel
developed by C++?
Also, Is there a .NET way which replaces WIN API DeviceIoControl?

thanks.
Jun 3 '07 #6
<al********@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
On Jun 3, 4:28 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
>Aneesh,

As of .NET 2.0, you don't need to use interop to get the handle to
named
events. You can call the static OpenExisting method to get a reference
to
an event which already exists and is named.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"Aneesh P" <anees...@gmail.comwrote in message

news:11*********************@z28g2000prd.googlegr oups.com...
On Jun 3, 11:53 am, alexia....@gmail.com wrote:
Hi all,
>I need to write app in C# that communicates with other app. I need to
use "named event" for that.
I should use windows APIs SetEvent() and WaitForSingleObject() etc...
I looked for help but couldn't find any.
>Can any one please help me with that?
>Thanks.
See this link:
http://www.codeproject.com/csharp/InteropEvents.asp- Hide quoted text -

- Show quoted text -

Hello Nicholas,

thanks you and the other guys for your reply.

Can I use OpenExisting to sync with events set by app run from kernel
developed by C++?
Also, Is there a .NET way which replaces WIN API DeviceIoControl?

thanks.

Yes, you have to call OpenExisting to get access to the handle, of course
you will need appropriate access rights for this to scucceed.
DeviceIOControl is not covered by the FCL, so you will have to "PInvoke" the
API, following is the DllImport declaration for DeviceIoControl.
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
internal static extern int DeviceIoControl(SafeFileHandle handle, uint
dwIoControlCode, IntPtr lpInBuffer,
int nInBufferSize, IntPtr lpOutBuffer, int nOutBufferSize,
out int lpBytesReturned, IntPtr lpOverlapped);
Willy.

Jun 3 '07 #7

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

Similar topics

4
by: Marc Elser | last post by:
Hi Everybody, Can someone please tell me how to access the form name if there's a form field named "name", for example: <form name="myform"> <input type="text" name="name" value="Marc">...
11
by: MLH | last post by:
I have a query field... Description: & "2-tone" When I run it, the output in that field is empty. If I change the name to MyDescription - it works fine. I noticed the query field has a...
4
by: Ying Lu | last post by:
Hello, I have a table named "USER" under MySQL database. When I am trying to move tables from MySQL to PostgreSQL, I found that I could not create a table namely "USER". I guess "USER" is a key...
3
by: Ravindra Tripathi | last post by:
Hi I have a form with a textbox and a close button. whenever I try to close the the form i get an exception "cannot access disposed object named" how do i correct this issue? Ravindra
3
by: Adam Hartshorne | last post by:
What is named parameter mechanism? Any ideas? I am looking through some code and there is a comment saying "VC++ has trouble with the named parameters mechanism", which i have no idea what this...
1
by: ye juan | last post by:
Hi, all I have some questions to ask: 1. How can I add a standard module named "datetime" in Jython when the error happens :"Traceback (innermost last): File "C:\python\test.py", line 3, in...
5
by: Jason | last post by:
Hello, I am trying to dynamically create a table, then set its <td>'s onclick: var table = document.createElement("table"); var row = table.insertRow(-1); var td = row.insertCell(-1);...
2
by: whitsey | last post by:
Trying to concatenate two fields into one however I seem unable to do so. All I want is to execute the following SELECT MONTH(L.DATE) ||' '|| YEAR(L.DATE) as MTH_OF_YEAR FROM LOG L But I...
4
by: Chris Botha | last post by:
The customer has a database with a column in a table named "System". I've been using this method for years now - create a dataset (an .xsd file) for the table. With a column named "System" in the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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.