B
Ben
Hi
I'm trying to setup a project that uses events. I'm creating a windows
forms based application.
The application interfaces to a DLL that controls a piece of external
hardware, whenever an action occurs on the hardware it needs to signal
my application.
The DLL instructions tell me to use CreateEvent to make the event, I
then pass the event handle to the DLL. This side of things seems to
work correctly and comes back with no errors.
What I'm having trouble with is how to tell the application to execute
this event. The event needs to read the hardware and then return to
the main program.
I could use a timer and continually poll the hardware but as the
hardware could signal at any time there is the danger I wouldn't be
able to pick up the messages quickly enough.
When an action is required the DLL uses SetEvent to signal the app.
My event creation code is:
(this is performed inside a button control on Form1)
HANDLE hGlobalLDVEvent;
hGlobalLDVEvent=CreateEventW(NULL,FALSE,FALSE,TEXT("LDVEVENT"));
hGlobalLDVEvent=OpenEventW(EVENT_ALL_ACCESS,FALSE,TEXT("LDVEVENT"));
this returns with 0x268 which I believe this indicated the event is
properly
created?
What do I need to do now?
Thanks for your help
Ben
I'm trying to setup a project that uses events. I'm creating a windows
forms based application.
The application interfaces to a DLL that controls a piece of external
hardware, whenever an action occurs on the hardware it needs to signal
my application.
The DLL instructions tell me to use CreateEvent to make the event, I
then pass the event handle to the DLL. This side of things seems to
work correctly and comes back with no errors.
What I'm having trouble with is how to tell the application to execute
this event. The event needs to read the hardware and then return to
the main program.
I could use a timer and continually poll the hardware but as the
hardware could signal at any time there is the danger I wouldn't be
able to pick up the messages quickly enough.
When an action is required the DLL uses SetEvent to signal the app.
My event creation code is:
(this is performed inside a button control on Form1)
HANDLE hGlobalLDVEvent;
hGlobalLDVEvent=CreateEventW(NULL,FALSE,FALSE,TEXT("LDVEVENT"));
hGlobalLDVEvent=OpenEventW(EVENT_ALL_ACCESS,FALSE,TEXT("LDVEVENT"));
this returns with 0x268 which I believe this indicated the event is
properly
created?
What do I need to do now?
Thanks for your help
Ben