473,473 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Event handling in VC++ 2005 .NET

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 the event is properly
created?

What do I need to do now?

Thanks for your help

Ben
Jul 11 '08 #1
3 1170
"Ben" <bc*******@hotmail.comwrote in message
news:78**********************************@26g2000h sk.googlegroups.com...
I'm trying to setup a project that uses events. I'm creating a Windows
forms-based application.
You're in the wrong newsgroup - this newsgroup is for ASP.NET issues.

Try: public.dotnet.languages.vc
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 11 '08 #2
winnt events are really event flags (a single variable). to be notified of
when an event value changes, use WaitForSingleObjectEx or
WaitForMutilpleObjectsEx (if you have more than 1 event).
-- bruce (sqlwork.com)
"Mark Rae [MVP]" wrote:
"Ben" <bc*******@hotmail.comwrote in message
news:78**********************************@26g2000h sk.googlegroups.com...
I'm trying to setup a project that uses events. I'm creating a Windows
forms-based application.

You're in the wrong newsgroup - this newsgroup is for ASP.NET issues.

Try: public.dotnet.languages.vc
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 11 '08 #3
"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:78**********************************@microsof t.com...
winnt events are really event flags (a single variable). to be notified of
when an event value changes, use WaitForSingleObjectEx or
WaitForMutilpleObjectsEx (if you have more than 1 event).
Yes I know...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 11 '08 #4

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

Similar topics

2
by: TogaKangaroo | last post by:
Hi, I'm trying to get intimate with my new copy of the .NET Pro developing environment, specifically C++ Visual Studio. I have a book (VC++ in 21 days) that I am going through following their...
3
by: VC | last post by:
I created an usercontrol ACTRL. and I fired an event from the ACTRL. in my form application, do all ACTRL controls have to do "+=" to sign up the event? my problem is if the ACTRL control in the...
3
by: Ashok Kumar K | last post by:
Hi all, Where can I get some insight on using the __hook, __unhook, event_source and event_receiver for specifically COM events. The documentation given in MSDN is very minimal. I have the...
0
by: Filippo Bettinaglio | last post by:
Hya, VC++ 2005, I have imported a type library in my MFC application (.exe) i can create the object and execute the methods. But I need to catch an event, i do how how to interface with it. ...
4
by: tlemcenvisit | last post by:
Hi, I program a windows form application with VC++.NET, I wish to program an event which occurs when the user uses the mouse wheel in a pictureBox control. Which event should I use? And how can...
1
by: simon | last post by:
I'm using VC++ 2003. My code throws lots of exceptions but the debugger's handling of these makes the program (and hence debugging process) unusably slow; this was not the case in VC++ 6. So my...
0
by: =?Utf-8?B?YW5rMmdv?= | last post by:
Hi, Thanks in advance for reading this. Not sure where to post this question, but I hope someone in here can help. Trying to write to Event Log in VS 2005 (.NET 2.0) using Enterprise Library...
7
by: Ben | last post by:
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...
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...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.