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

C / C++ / MFC

 
GeneralRe: Converting Cstring to float Pin
Member 166473319-Jan-05 0:28
Member 166473319-Jan-05 0:28 
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 
I've created a UI thread and I want my main app to send a message to it. So in my main app I make a call to PostThreadMessage.

In the message map of my UI thread I have:

<br />
BEGIN_MESSAGE_MAP(CMyThread, CWinThread)<br />
	//}}AFX_MSG_MAP<br />
	ON_THREAD_MESSAGE(UWM_STOPTHREAD, OnStopThread)<br />
END_MESSAGE_MAP()<br />


However when I post my message to the thread it never reaches the OnStopThread function that I created. Also I get an error if my function is set like this:

<br />
LRESULT CMyThread::OnStopThread(WPARAM wParam, LPARAM lParam)<br />
{<br />
	AfxMessageBox("OnStopThread");<br />
	m_sConnectSocket.Close();<br />
	PostMessage(myHandle->m_hWnd,UWM_DISCONNECTED, 0, (LPARAM)&thdID);<br />
	ExitInstance();<br />
	return true;<br />

Where it returns an LRESULT. If I take this out and make it a void then it compiles fine but still does not work.

Here is the error I'm getting:
MyThread.cpp(55) : error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CMyThread::* )(WPARAM,LPARAM)' to 'void (__thiscall CWinThread::* )(WPARAM,LPARAM)'


I'm thinking of just putting a PeekMessage in the PreTranslateMessage and do my calls from here, but from what I've read on flounder.com, this is not a good idea.

Any suggestion please

Thanks

Tom Wright
tawright915@yahoo.com
GeneralRe: UI thread question Pin
Serge Krynine18-Jan-05 12:12
Serge Krynine18-Jan-05 12:12 
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 

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.