Owe,
>Now one of the apps will be .NET, the one that will do the OpenEvent(..),
>the problem is I cannot find out how to do the OpenEvent(...) bit.
>
>Anybody knows???
[DllImport("kernel32.dll", CharSet=CharSet.Auto)]
static extern IntPtr OpenEvent(uint dwDesiredAccess, bool
bInheritHandle, string lpName);
[DllImport("kernel32.dll")]
static extern bool CloseHandle(IntPtr hObject);
const uint EVENT_ALL_ACCESS = 0x1F0003;
...
IntPtr hEvent = OpenEvent(EVENT_ALL_ACCESS, true, "EVENTNAME");
... use event ...
CloseHandle(hEvent);
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Owe Armandt - 10 Jan 2004 14:33 GMT
So you mean there is no .NET way of doing this other than using unmanaged
code by importing the functions like this??
Owe
> Owe,
>
[quoted text clipped - 24 lines]
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
"Ying-Shen Yu[MSFT]" - 13 Jan 2004 02:44 GMT
Hi Owe,
If you want to sync with other unmanaged apps, PInvoke is needed, since as
I know .NET does not provide a way to create/open a named event.
If you want to sync with managed apps, it might be better to use some other
mechanism, such as .NET Remoting.
Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.