Scenario:
We're busy wrapping up a 3rd party's C++ SDK as a DLL to make it simpler for other developers in our organisation to integrate this functionality into their own apps (be it, .net, delphi, etc)
The underlying system sends Windows messages to signal events that occur in the system. These events need to be dealt with, as they could potentially signal the state of the system and what can be done next.
Question:
What would the best way be to handle these messages within the context of the approach we are taking (i.e a DLL that wraps up the 3rd party SDK)? Some ideas that come to mind:
- Let the application using the DLL trap the message, and then pass it back to the DLL via a function call for processing -- is it even possible for the calling application to trap these messages?
- Spawn a thread from within the DLL that implements a message pump that handles these messages from the underlying system and bubbles up our own custom messages?
All sample code given for the SDK uses a single Win32 app that implements a message pump and handles the messages within the context of the application.
Its been ages since I have done Windows development using native Win32 and would appreciate some advice.