PDA

View Full Version : Qt and Windows messaging



bnilsson
6th January 2010, 17:03
I am trying to write a small application for a USB camera live display under Windows. I use Qt because I like it, and have never used Windows native code. The application is not cross-platform, since the camera API is using Windows messages, e.g. from some sample Windows code:

BEGIN_MESSAGE_MAP(CIdSimpleLiveDlg,CDIalog)
.
.
ON_MESSAGE(IS_UEYE_MESSAGE,OnuEyeMessage); // This method is called when a IS_UEYE_MESSAGE type message is emitted
.
END_MESSAGE_MAP()

The camera is sending a IS_UEYE_MESSAGE when it has something to say, such as a frame is ready to capture etc.

OnUEyeMessage(WPARAM event, LPARAM hCam)

Is there any way I can setup and catch Windows messages and use them in the Qt environment?
If not, is there a way to connect a MESSAGE_MAP to a Qt object?

Or is this just futile, and I have to learn Windows programming (sigh).

BN

wysota
6th January 2010, 17:46
See QWidget::winEvent().