Mapping Notify Messages to a function

  • Thread starter Thread starter bg_ie
  • Start date Start date
B

bg_ie

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.
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top