Click here to Skip to main content
15,897,968 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: How to prevent Quicksort stack overflow? Pin
Richard MacCutchan12-Nov-09 9:14
mveRichard MacCutchan12-Nov-09 9:14 
QuestionERROR - Object deleted before window was destroyed Pin
kcynic12-Nov-09 1:23
kcynic12-Nov-09 1:23 
AnswerRe: ERROR - Object deleted before window was destroyed Pin
Stuart Dootson12-Nov-09 5:03
professionalStuart Dootson12-Nov-09 5:03 
GeneralRe: ERROR - Object deleted before window was destroyed Pin
kcynic12-Nov-09 14:00
kcynic12-Nov-09 14:00 
GeneralRe: ERROR - Object deleted before window was destroyed Pin
kcynic12-Nov-09 23:45
kcynic12-Nov-09 23:45 
QuestionATL Exe Service Pin
Anthony988710-Nov-09 3:45
Anthony988710-Nov-09 3:45 
QuestionRe: ATL Exe Service Pin
ChrisSieben1-Dec-09 3:58
ChrisSieben1-Dec-09 3:58 
QuestionWTL Custom message handling in the message map? [modified] Pin
Member 38198215-Nov-09 23:13
Member 38198215-Nov-09 23:13 
I've written a multi-threaded WTL util to stress test an in-house service.

Comms threads signal to the main thread that they've quit, so the main thread can delete their corresponding object.

They make the signal as so:

PostThreadMessage(m_dwParentThreadId, WM_THREADQUIT, 1, m_dwNetThreadId);

My problem is how to deal with the custom message I've defined .

WM_THREADQUIT is #define'd as WM_USER + 10

I wanted to use an entry in the message map to call a handler, e.g.:
BEGIN_MSG_MAP(CMainDlg)
MESSAGE_HANDLER( WM_INITDIALOG, OnInitDialog )
MESSAGE_HANDLER( WM_THREADQUIT, OnThreadQuit )
...
REFLECT_NOTIFICATIONS()
END_MSG_MAP()

However, OnThreadQuit is never called.

The only way I can handle it is by calling the handler explicitly in PreTranslateMessage:

virtual BOOL CMainDlg::PreTranslateMessage(MSG* pMsg)
{
if( pMsg->message == WM_THREADQUIT )
{
BOOL blHandled;
OnThreadQuit(pMsg->message, pMsg->wParam, pMsg->lParam, blHandled);
return TRUE;
}
return CWindow::IsDialogMessage(pMsg);
}

I'm sure this isn't the correct way to do it ...

I'd love to know the correct way- can someone help!?

thanks

modified on Friday, November 6, 2009 6:46 AM

AnswerRe: WTL Custom message handling in the message map? Pin
KingsGambit9-Nov-09 9:03
KingsGambit9-Nov-09 9:03 
QuestionHow to change button color in ATL Pin
am 20094-Nov-09 20:08
am 20094-Nov-09 20:08 
AnswerRe: How to change button color in ATL Pin
«_Superman_»5-Nov-09 8:24
professional«_Superman_»5-Nov-09 8:24 
QuestionHow to access custom ActiveX object properties in ATL Composite Control Pin
komofilms774-Nov-09 19:52
komofilms774-Nov-09 19:52 
QuestionHow to remove type library informationn from atl dll? Pin
kcynic4-Nov-09 15:33
kcynic4-Nov-09 15:33 
AnswerRe: How to remove type library informationn from atl dll? Pin
Lim Bio Liong4-Nov-09 16:17
Lim Bio Liong4-Nov-09 16:17 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic4-Nov-09 16:30
kcynic4-Nov-09 16:30 
GeneralRe: How to remove type library informationn from atl dll? Pin
Lim Bio Liong4-Nov-09 16:46
Lim Bio Liong4-Nov-09 16:46 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic4-Nov-09 16:53
kcynic4-Nov-09 16:53 
GeneralRe: How to remove type library informationn from atl dll? Pin
Lim Bio Liong4-Nov-09 17:04
Lim Bio Liong4-Nov-09 17:04 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic4-Nov-09 17:12
kcynic4-Nov-09 17:12 
GeneralRe: How to remove type library informationn from atl dll? Pin
Lim Bio Liong4-Nov-09 17:26
Lim Bio Liong4-Nov-09 17:26 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic4-Nov-09 18:38
kcynic4-Nov-09 18:38 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic2-Dec-09 19:08
kcynic2-Dec-09 19:08 
GeneralRe: How to remove type library informationn from atl dll? Pin
Lim Bio Liong2-Dec-09 23:24
Lim Bio Liong2-Dec-09 23:24 
GeneralRe: How to remove type library informationn from atl dll? Pin
kcynic3-Dec-09 2:19
kcynic3-Dec-09 2:19 
News[Message Deleted] Pin
Ahmed Charfeddine4-Nov-09 2:07
Ahmed Charfeddine4-Nov-09 2:07 

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.