Click here to Skip to main content
16,008,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to totally hide main frame window of SDI MFC application? Pin
markkuk9-May-01 23:49
markkuk9-May-01 23:49 
GeneralCFileDialog with OFN_ALLOWMULTISELECT Pin
9-May-01 16:44
suss9-May-01 16:44 
GeneralRe: Try this. Pin
Masaaki Onishi9-May-01 17:39
Masaaki Onishi9-May-01 17:39 
GeneralRe: :)Thanks. Pin
9-May-01 19:10
suss9-May-01 19:10 
Generalcapturing DOS console txt... Pin
9-May-01 15:18
suss9-May-01 15:18 
GeneralRelease DLL Crash Pin
9-May-01 14:23
suss9-May-01 14:23 
GeneralDesigning a GUI in DOS Pin
Fabian Glace9-May-01 12:33
Fabian Glace9-May-01 12:33 
GeneralAvoiding Deadlocks Pin
Chris Meech9-May-01 10:31
Chris Meech9-May-01 10:31 
I have developed a CListBox based control that overrides, PreSubClass() and OnDestroy(). In PreSubCLass a worker thread is created to query a database for the data to put into the control. The deadlock occurs when the user closes the dialog and the worker thread is still running. I over rode OnDestroy() to signal the thread to terminate and then WaitForSingleObject() to get signalled that the thread has terminated. I am using events to handle this synchronization. Unfortunately the threads deadlock as the UI thread is processing a window message, OnDestroy() and the worker is trying to call AddString which in turn calls ::SendMessage() which now blocks the worker thread. I've tried using a PostMessage call instead and that seemed to solve the deadlock issue. Unfortunately, it also had the side effect that the strings added to the list box never get displayed until the worker thread is complete. Incidently the worker thread checks for the signalled event to terminate within the while loop that is processing all the data returned from the database. Everything works fine, except when the dialog is closed while the worker thread is still running. Any ideas from some more experienced folk? Thanks.

Chris
GeneralRe: Hummm... (^|^) Pin
Masaaki Onishi9-May-01 14:54
Masaaki Onishi9-May-01 14:54 
GeneralLinking Multiple Dialog Boxes Pin
9-May-01 10:03
suss9-May-01 10:03 
GeneralRe: So, PropertySheet exists. Pin
Masaaki Onishi9-May-01 10:16
Masaaki Onishi9-May-01 10:16 
GeneralRe: Linking Multiple Dialog Boxes Pin
Christian Graus9-May-01 12:35
protectorChristian Graus9-May-01 12:35 
QuestionGraph and Grid Control Tools? Pin
Keith Ramey9-May-01 6:10
Keith Ramey9-May-01 6:10 
AnswerRe: Graph and Grid Control Tools? Pin
George Chastain9-May-01 7:06
George Chastain9-May-01 7:06 
GeneralWTL LoadBitmap in client area Pin
9-May-01 5:15
suss9-May-01 5:15 
GeneralRe: WTL LoadBitmap in client area Pin
Christian Graus9-May-01 12:37
protectorChristian Graus9-May-01 12:37 
GeneralRe: WTL LoadBitmap in client area Pin
10-May-01 8:00
suss10-May-01 8:00 
Questionhow to detect end of line, end of file and CR? Pin
hearties9-May-01 4:52
hearties9-May-01 4:52 
AnswerRe: how to detect end of line, end of file and CR? Pin
l a u r e n9-May-01 7:01
l a u r e n9-May-01 7:01 
AnswerRe: how to detect end of line, end of file and CR? Pin
Stuart van Weele9-May-01 9:35
Stuart van Weele9-May-01 9:35 
GeneralNon Moving dialog box Pin
9-May-01 4:40
suss9-May-01 4:40 
GeneralRe: Non Moving dialog box Pin
Sivakumar9-May-01 4:50
Sivakumar9-May-01 4:50 
GeneralRe: Non Moving dialog box Pin
9-May-01 5:14
suss9-May-01 5:14 
GeneralRe: Check Paul DiLascia code. Pin
Masaaki Onishi9-May-01 5:46
Masaaki Onishi9-May-01 5:46 
GeneralRe: Non Moving dialog box Pin
Stuart van Weele9-May-01 9:42
Stuart van Weele9-May-01 9:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.