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

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

callback function and SendMessage.

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

Thankyou,
Aruna.
0
gadige
Asked:
gadige
1 Solution
 
AgariciCommented:
SendMessage waits for the message to be handled -- maybe that is the problem, so try using PostMessage instead
0

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