473,382 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Mapping Notify Messages to a function

Hi.

I have writen a C# Com object which interacts with a piece of hardware
via a C library. At the moment I poll this hardware from within my C#
assembly to see when new messages are received. The C library also
contains a function called setNotify() which posts a
WM__HARDWARELIBRARY message when new messages are recieved by the
hardware. But how do I map WM__HARDWARELIBRARY to a function in my C#
code so that this function is called when messages arrive at the
hardware?

Thanks,

Barry.

Feb 9 '07 #1
2 1520
On 9 Feb, 12:37, b...@yahoo.com wrote:
Hi.

I have writen a C# Com object which interacts with a piece of hardware
via a C library. At the moment I poll this hardware from within my C#
assembly to see when new messages are received. The C library also
contains a function called setNotify() which posts a
WM__HARDWARELIBRARY message when new messages are recieved by the
hardware. But how do I map WM__HARDWARELIBRARY to a function in my C#
code so that this function is called when messages arrive at the
hardware?

Thanks,

Barry.
I should mention also that setNotify() takes a HWND to the window that
will capture the message.

Feb 9 '07 #2
On Feb 9, 6:53 am, b...@yahoo.com wrote:
On 9 Feb, 12:37, b...@yahoo.com wrote:
Hi.
I have writen a C# Com object which interacts with a piece of hardware
via a C library. At the moment I poll this hardware from within my C#
assembly to see when new messages are received. The C library also
contains a function called setNotify() which posts a
WM__HARDWARELIBRARY message when new messages are recieved by the
hardware. But how do I map WM__HARDWARELIBRARY to a function in my C#
code so that this function is called when messages arrive at the
hardware?
Thanks,
Barry.

I should mention also that setNotify() takes a HWND to the window that
will capture the message.
Barry,

You have several options. The two that jump out at me both involve
intercepting the message by either overriding the WndProc method of
the window or creating an IMessageFilter that you attach to the
message loop.

Brian
Feb 9 '07 #3

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

Similar topics

6
by: naruto | last post by:
Hi all, I have the following being defined in a A.cxx file. // define in source file. Not exported to the outside world (this cannot be // moved to the header file ) #define CHANNEL_0 0...
1
by: Alessandro GARDICH | last post by:
Hi to all I have problem with NOTIFY/LISTEN ... I'm writing a C++ application with libpqxx, I thought was a problem of the lib but I try also with a C program using libpq with the same result,...
0
by: Joel | last post by:
Hello: I have some question about some data type mapping for some data type of my c++ dll Data Type Mapping ----------------------------------- type are time_t tm char *message
4
by: BentleyInc | last post by:
I'm trying to find a way to add a whildcard application mapping to aspnet_isapi.dll in IIS programmatically.... been looking into IIS administrator reference but didn't find the right function to...
4
by: Joe Lester | last post by:
I'm using PostgreSQL 7.4.1. I have 140 clients connected on average using libpq. When one client sends "NOTIFY timeclock;" to the server all 140 clients are listening for it. After receiving a...
3
by: Frank van Vugt | last post by:
L.S. Either the docs or I are missing something.... While using libpq I noticed that listen/notify calls were being converted to lowercase. A further look showed that the listen/notify calls...
3
by: Mark Denardo | last post by:
Does anyone have any good VB.NET example code that shows how to use the NOTIFY option using the mciSendString API and then handle the return value. The only examples I can find show the VB way...
0
by: guy | last post by:
Mapping form property to app.config works great in VB2005 but causes a slew of information messages. Message 1 Could not find schema information for the element 'userSettings'. How to supress...
5
by: alan | last post by:
Hello world, I'm wondering if it's possible to implement some sort of class/object that can perform mapping from class types to strings? I will know the class type at compile time, like so:...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.