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

Deadlock problem using AfxBeginThread

I have a modeless dialog that I spawn a seperate thread using m_hGThread1=AfxBeginThread(Animate_Graph,0,THREAD_PRIORITY_NORMAL,0,0,NULL) to handle the graphics seperately from the dialog. I'm using a critical section for locking. Under stress testing it deadlocks the application. Using VC7/MFC. What am I doing wrong?
0
_kp
Asked:
_kp
1 Solution
 
rde011176Commented:
Can you provide a code snippet?
0
 
_kpAuthor Commented:
I think it may be a design problem. I need to figure out how to attach to the CStatic picture control that holds the bitmap I'm modifying. Seems to hang in the message pump.
0
 
bkrahmerCommented:
Think about giving test-first design a try.  I would bet that you wouldn't have gotten stuck there if you had.  It forces you to take your programming step-by-step, but correctly the whole way.  It can also be fun.  Check it out.
brian
0
 
Computer101Commented:
A request for deletion has been made.  If no response or you feel this is in error, comment.  If no objection, I will delete in three days.

Computer101
E-E Admin
0
 
SpideyModCommented:
PAQ'd and points refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

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