Hi guys,
I'm having a hard time to subscribe to a native event in C#.NET. The
application I'm writing should be able to detect changes in DHCP
parameters. This is done through the following:
DWORD APIENTRY DhcpRegisterParamChange(
DWORD Flags,
LPVOID Reserved,
LPWSTR AdapterName,
LPDHCPCAPI_CLASSID pClassId,
DHCPCAPI_PARAMS_ARRAY Params,
LPVOID Handle
);
How do I tackle this? Do I have to use CreateEvent from kernel32.dll to
subscribe to this event? And how do I consume this event from managed
code (i.e. C#.NET)?
Thanks in advance,
Benny
Mattias Sjögren - 23 Feb 2006 21:06 GMT
Benny,
>How do I tackle this? Do I have to use CreateEvent from kernel32.dll to
>subscribe to this event?
From the usage examples at
http://msdn.microsoft.com/library/en-us/dhcp/dhcp/dhcp_client_api_examples.asp
it seems like you don't have to create the event object yourself,
rather it's returned by the API.
>And how do I consume this event from managed
>code (i.e. C#.NET)?
You can use the Wait APIs manually (like the sample code) or wrap it
in a managed WaitHandle.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.