Re: "Named Event"

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

<alexia.bee@xxxxxxxxx> wrote in message news:1180891516.819347.214450@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 3, 4:28 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
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...@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Aneesh P" <anees...@xxxxxxxxx> wrote in message

news:1180859377.068957.95650@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



> On Jun 3, 11:53 am, alexia....@xxxxxxxxx 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.


.