Click here to Skip to main content
15,850,265 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalexecute an app from code Pin
BlackDice12-Apr-04 8:58
BlackDice12-Apr-04 8:58 
GeneralRe: execute an app from code Pin
T1TAN12-Apr-04 9:15
T1TAN12-Apr-04 9:15 
GeneralRe: execute an app from code Pin
BlackDice12-Apr-04 9:44
BlackDice12-Apr-04 9:44 
GeneralRe: execute an app from code Pin
Ed K12-Apr-04 9:34
Ed K12-Apr-04 9:34 
GeneralRe: execute an app from code Pin
BlackDice12-Apr-04 9:45
BlackDice12-Apr-04 9:45 
GeneralRe: execute an app from code Pin
Snyp12-Apr-04 12:26
Snyp12-Apr-04 12:26 
GeneralRe: execute an app from code Pin
Tim Smith12-Apr-04 19:21
Tim Smith12-Apr-04 19:21 
QuestionASSERT_VALID ? Pin
Jnewg512-Apr-04 8:13
Jnewg512-Apr-04 8:13 
I am writing an application that performs custom titlebar painting. I have been using Paul DiLascia's CCaptionPainter class to accomplish this. Things have been working fairly well until I have come across a problem with modeless dialogs(a debug ASSERT_VALID). My main application is where the title bar painting occurs. I have various submenus that launches various other dialogs. I have noticed that when I launch a modeless dialog and move it, the OnNcPaint routine in my CCaptionPainter class ASSERT_VALID(m_pWndHooked) /*class member CWnd object reference*/ produces the following assertion in WinCore.cpp. I have googled the below snippet from WinCore.cpp, but have not come up with anything that makes sense. I am not passing my CWnd object from thread to thread and am wondering if anyone has seen other variations of this assertion. Thanks!


CObject* p;
ASSERT((p = pMap->LookupPermanent(m_hWnd)) != NULL ||
(p = pMap->LookupTemporary(m_hWnd)) != NULL);
ASSERT((CWnd*)p == this); // must be us

// Note: if either of the above asserts fire and you are
// writing a multithreaded application, it is likely that
// you have passed a C++ object from one thread to another
// and have used that object in a way that was not intended.
// (only simple inline wrapper functions should be used)
//
// In general, CWnd objects should be passed by HWND from
// one thread to another. The receiving thread can wrap
// the HWND with a CWnd object by using CWnd::FromHandle.
//
// It is dangerous to pass C++ objects from one thread to
// another, unless the objects are designed to be used in
// such a manner.
AnswerRe: ASSERT_VALID ? Pin
Anthony_Yio13-Apr-04 1:21
Anthony_Yio13-Apr-04 1:21 
GeneralCWinThread "issues" Pin
T1TAN12-Apr-04 7:59
T1TAN12-Apr-04 7:59 
GeneralRe: CWinThread "issues" Pin
John M. Drescher12-Apr-04 9:18
John M. Drescher12-Apr-04 9:18 
GeneralRe: CWinThread "issues" Pin
T1TAN12-Apr-04 9:53
T1TAN12-Apr-04 9:53 
GeneralRe: CWinThread "issues" Pin
John M. Drescher12-Apr-04 9:58
John M. Drescher12-Apr-04 9:58 
GeneralRe: CWinThread "issues" Pin
T1TAN12-Apr-04 10:17
T1TAN12-Apr-04 10:17 
GeneralRe: CWinThread "issues" Pin
John M. Drescher12-Apr-04 10:33
John M. Drescher12-Apr-04 10:33 
GeneralRe: CWinThread "issues" Pin
T1TAN12-Apr-04 10:41
T1TAN12-Apr-04 10:41 
GeneralRe: CWinThread "issues" Pin
John M. Drescher12-Apr-04 11:36
John M. Drescher12-Apr-04 11:36 
GeneralRe: CWinThread "issues" Pin
dreamerzz18-Apr-04 1:07
dreamerzz18-Apr-04 1:07 
GeneralRe: CWinThread "issues" Pin
John M. Drescher18-Apr-04 19:13
John M. Drescher18-Apr-04 19:13 
GeneralRe: CWinThread "issues" Pin
dreamerzz20-Apr-04 3:15
dreamerzz20-Apr-04 3:15 
GeneralRe: CWinThread "issues" Pin
John M. Drescher20-Apr-04 5:28
John M. Drescher20-Apr-04 5:28 
GeneralCreating string from BSTR Pin
yanuart12-Apr-04 7:25
yanuart12-Apr-04 7:25 
GeneralRe: Creating string from BSTR Pin
Darshan Jani12-Apr-04 8:02
Darshan Jani12-Apr-04 8:02 
GeneralRe: Creating string from BSTR Pin
GuimaSun12-Apr-04 8:07
GuimaSun12-Apr-04 8:07 
GeneralKeep the Client DC state in a Bitmap Pin
stelitsisan12-Apr-04 6:40
stelitsisan12-Apr-04 6:40 

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.