Reputation: 485
I am creating an application with the following characteristics:
mainLib
).mainLib
dll, uses another dll (lets call it commManager
) that manages TCP communication with another app.My problem, is how to make commManager
notify the mainLib
about certain messages it receives.
I suppose something like PostThreadMessage()
could be the solution, but how
do I implement it inside the dll?
Upvotes: 0
Views: 354
Reputation: 13533
Presumably, commManager runs on it's own thread. mainLib would need to create a message queue as described here. When mainLib creates commManager it would have to pass its thread id to it.
If you want blocking, another option would be to use callbacks. Have mainLib pass commManager a function pointer.
Upvotes: 1