AfxMessage doesn’t block
-
Hi I’m again having different results in debug and release this one isn’t a bug but different program behavior. I have 4 CwinThread Wrappers for CAsynSocket In debug because processing is slowed somewhat by int 3 breakpoints I Receive all my about 3500 bytes of data from the Mainframe computer. In release I don’t get it all in one transmission I have a full word or a short int in the begging of the stream to tell me how much data My method to debug this in the past was issue a AfxMessage and attach the debugger This always seemed to work with the Mainthread I didn’t even notice the message box come up in this scenario except by hovering my mouse on the tray at the bottom of the screen I don’t think I can use __debugbreak in Release Anyway to stop this thread so that I can attach the debugger to see what’s going on I forgot to add this UI thread was created before I created the CMainFrame Window however in the past I was able to have an AfxMessageBox in the CWinApp constructor and it worked Thanks
-
Hi I’m again having different results in debug and release this one isn’t a bug but different program behavior. I have 4 CwinThread Wrappers for CAsynSocket In debug because processing is slowed somewhat by int 3 breakpoints I Receive all my about 3500 bytes of data from the Mainframe computer. In release I don’t get it all in one transmission I have a full word or a short int in the begging of the stream to tell me how much data My method to debug this in the past was issue a AfxMessage and attach the debugger This always seemed to work with the Mainthread I didn’t even notice the message box come up in this scenario except by hovering my mouse on the tray at the bottom of the screen I don’t think I can use __debugbreak in Release Anyway to stop this thread so that I can attach the debugger to see what’s going on I forgot to add this UI thread was created before I created the CMainFrame Window however in the past I was able to have an AfxMessageBox in the CWinApp constructor and it worked Thanks
Why are you using AfxMessageBox in a secondary thread? :confused:
-
Why are you using AfxMessageBox in a secondary thread? :confused:
-
Will use Message box establish my main window before thread creation and will move the CFrameWnd ::m_hWnd to UI thread window thanks
It is not a good design to display a messagebox form any secondary thread. Better would be PostMessage a user defined message to the main GUI thread with the parameters that you want to be displayed and let the main thread display it.
-
It is not a good design to display a messagebox form any secondary thread. Better would be PostMessage a user defined message to the main GUI thread with the parameters that you want to be displayed and let the main thread display it.