troubleshooting Question

PostMessage not working properly

Avatar of davinder101
davinder101 asked on
System Programming
2 Comments1 Solution349 ViewsLast Modified:
Hi,
i am using PostMessage() function in the InitDialog() function. The handler called by by the PostMessage funtion is used for creating a tree.  But the dialog become visible after creating the tree. I don't know why, after using PostMessage function function the application is not getting the control immediately .
Thanks.

Code-
#define WM_CREATE_MYTREE WM_APP+7
BEGIN_MESSAGE_MAP(CRestore, CDialog)
      //{{AFX_MSG_MAP(CRestore)
      ON_MESSAGE(WM_CREATE_MYTREE, DisplayTree)
      //}}AFX_MSG_MAP
END_MESSAGE_MAP()

BOOL CRestore::OnInitDialog()
{
   do something ---
   --------------
  PostMessage(WM_CREATE_MYTREE, 0, 0);
  return TRUE;
}
LRESULT CRestore::DisplayTree(WPARAM wParam, LPARAM lParam)
{
      InsertIntoTree();
      return 0;
}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros