Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Converting Cstring to float Pin
jhwurmbach6-Apr-05 5:40
jhwurmbach6-Apr-05 5:40 
GeneralRe: Converting Cstring to float Pin
vaibhavbvp3-Feb-13 18:20
vaibhavbvp3-Feb-13 18:20 
GeneralOutside the window Pin
Anonymous18-Jan-05 8:37
Anonymous18-Jan-05 8:37 
GeneralRe: Outside the window Pin
User 665818-Jan-05 11:03
User 665818-Jan-05 11:03 
GeneralRe: Outside the window Pin
Garth Watkins18-Jan-05 22:01
Garth Watkins18-Jan-05 22:01 
GeneralCDialog child of a toolbar Pin
Giuliana18-Jan-05 8:27
Giuliana18-Jan-05 8:27 
GeneralUI thread question Pin
Tom Wright18-Jan-05 7:33
Tom Wright18-Jan-05 7:33 
GeneralRe: UI thread question Pin
Serge Krynine18-Jan-05 12:12
Serge Krynine18-Jan-05 12:12 
Tom,

here are two extracts from one of my class (I have removed all unrelated code) that does similar things and works well. Just verify you've got all declarations and definitions right. May be this will help.

Regards,
Serge Krynine

Header File:

class CLogDocument : public CWinThread
{
DECLARE_DYNAMIC(CLogDocument)
enum EThreadMessage
{
WM_ON_LOG_MESSAGE = WM_USER + 1000
};
afx_msg void OnLogMessage(WPARAM nWparam, LPARAM nLparam);
DECLARE_MESSAGE_MAP()
}; // class CLogDocument

Source File:

///////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNAMIC(CLogDocument, CWinThread)

///////////////////////////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(CLogDocument, CWinThread)
ON_THREAD_MESSAGE(EThreadMessage::WM_ON_LOG_MESSAGE, OnLogMessage)
END_MESSAGE_MAP()

///////////////////////////////////////////////////////////////////////
CLogDocument::~CLogDocument()
{
CWinThread::PostThreadMessage(WM_QUIT, 0, 0);
}

///////////////////////////////////////////////////////////////////////
bool CLogDocument::LogMessage(CString const& rstrMessage)
{
DWORD nResult = CWinThread::PostThreadMessage(EThreadMessage::WM_ON_LOG_MESSAGE,
reinterpret_cast<wparam>(pstrMessage),
NULL);
}

///////////////////////////////////////////////////////////////////////
void CLogDocument::OnLogMessage(WPARAM const nWparam, LPARAM const /*nLparam*/)
{
}
GeneralRe: UI thread question Pin
Tom Wright19-Jan-05 11:20
Tom Wright19-Jan-05 11:20 
QuestionHow can I affect the result of GetClientRect? Pin
Dimitris Vikeloudas18-Jan-05 7:17
Dimitris Vikeloudas18-Jan-05 7:17 
AnswerRe: How can I affect the result of GetClientRect? Pin
HurricaneFlossie18-Jan-05 8:28
HurricaneFlossie18-Jan-05 8:28 
AnswerRe: How can I affect the result of GetClientRect? Pin
Shog918-Jan-05 11:32
sitebuilderShog918-Jan-05 11:32 
GeneralSubclassing ListBox so as to provide functionality of both single selection and multiple selection list box Pin
Close Network18-Jan-05 6:58
Close Network18-Jan-05 6:58 
GeneralRe: Subclassing ListBox so as to provide functionality of both single selection and multiple selection list box Pin
David Crow18-Jan-05 7:07
David Crow18-Jan-05 7:07 
GeneralRe: Subclassing ListBox so as to provide functionality of both single selection and multiple selection list box Pin
Close Network18-Jan-05 13:05
Close Network18-Jan-05 13:05 
GeneralRe: Subclassing ListBox so as to provide functionality of both single selection and multiple selection list box Pin
David Crow19-Jan-05 2:52
David Crow19-Jan-05 2:52 
GeneralRe: Subclassing ListBox so as to provide functionality of both single selection and multiple selection list box Pin
HurricaneFlossie18-Jan-05 7:32
HurricaneFlossie18-Jan-05 7:32 
GeneralPerformance Graph... Pin
utkumanyaksalak18-Jan-05 6:56
utkumanyaksalak18-Jan-05 6:56 
QuestionHow to Detect Presence of a Scrollbar Pin
HurricaneFlossie18-Jan-05 5:54
HurricaneFlossie18-Jan-05 5:54 
AnswerRe: How to Detect Presence of a Scrollbar Pin
Tom Wright18-Jan-05 10:35
Tom Wright18-Jan-05 10:35 
GeneralRe: How to Detect Presence of a Scrollbar Pin
HurricaneFlossie18-Jan-05 11:01
HurricaneFlossie18-Jan-05 11:01 
AnswerRe: How to Detect Presence of a Scrollbar Pin
Shog918-Jan-05 10:59
sitebuilderShog918-Jan-05 10:59 
GeneralRe: How to Detect Presence of a Scrollbar Pin
HurricaneFlossie18-Jan-05 11:28
HurricaneFlossie18-Jan-05 11:28 
GeneralRe: How to Detect Presence of a Scrollbar Pin
Tom Wright18-Jan-05 12:38
Tom Wright18-Jan-05 12:38 
GeneralAuto left click Pin
Raylan18-Jan-05 4:36
Raylan18-Jan-05 4:36 

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.