Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 600
  • Last Modified:

callback function and SendMessage.

Here is a design of a peice of code. Let me know if this can cause a race condition or a deadlock.

I have an MFC application, which is using and linking to a MFC extension dll. In my MFC extension dll, i have a class which  holds a callback pointer of one class instance of the main MFC application. When an event is received, this callback pointer is called from the MFC extension dll new thread(second thread in dll always alive). The callback handler function in the main application does a SendMessage to one of its child windows or to itself. If the callback from the MFC extension is called multiple times, all the messages sent to a window from the callback handler are not received by that window. Is there something wrong in this?? Let me know any good solution to this kind of problems.

1 Solution
SendMessage waits for the message to be handled -- maybe that is the problem, so try using PostMessage instead

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now