Click here to Skip to main content
15,906,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Guess what... another edit problem! :) Remove "pling" when I press enter! Pin
Rickard Andersson205-Feb-03 2:18
Rickard Andersson205-Feb-03 2:18 
GeneralRe: Guess what... another edit problem! :) Remove "pling" when I press enter! Pin
Rickard Andersson205-Feb-03 3:02
Rickard Andersson205-Feb-03 3:02 
GeneralRe: Guess what... another edit problem! :) Remove "pling" when I press enter! Pin
georgiek506-Feb-03 14:32
georgiek506-Feb-03 14:32 
GeneralRe: Guess what... another edit problem! :) Remove "pling" when I press enter! Pin
Rickard Andersson206-Feb-03 21:13
Rickard Andersson206-Feb-03 21:13 
GeneralRe: Guess what... another edit problem! :) Remove "pling" when I press enter! Pin
georgiek507-Feb-03 0:10
georgiek507-Feb-03 0:10 
GeneralRe: Guess what... another edit problem! :) Remove "pling" when I press enter! Pin
Rickard Andersson207-Feb-03 0:25
Rickard Andersson207-Feb-03 0:25 
GeneralRe: Guess what... another edit problem! :) Remove "pling" when I press enter! Pin
georgiek507-Feb-03 2:37
georgiek507-Feb-03 2:37 
GeneralSend a message from a thread to a function with parameters Pin
willempipi5-Feb-03 0:48
willempipi5-Feb-03 0:48 
I've got this working:

The Thread:
<br />
<small>UINT CheckMessages(LPVOID Param)<br />
{<br />
	CString tekst = "This is a tekst or maybe a structure";<br />
	::PostMessage((HWND)Param, WM_DATARECEIVED, (WPARAM)&tekst, 0);<br />
	return 0;<br />
}</small><br />


The header:
<br />
<small>protected:<br />
	//{{AFX_MSG(CPLCClientView)<br />
	afx_msg void OnDataReceived(WPARAM wParam, LPARAM lParam);<br />
//}}AFX_MSG<br />
	DECLARE_MESSAGE_MAP()</small><br />


The Function:
<br />
<small>BEGIN_MESSAGE_MAP(CPLCClientView, CFormView)<br />
	//{{AFX_MSG_MAP(CPLCClientView)<br />
	ON_MESSAGE(WM_DATARECEIVED, OnDataReceived)<br />
	//}}AFX_MSG_MAP<br />
END_MESSAGE_MAP()<br />
<br />
...<br />
<br />
...<br />
<br />
void CMyClass::OnDataReceived(WPARAM wParam, LPARAM lParam)<br />
{<br />
	CString tekst = (CString)wParam; // or something like that....<br />
	AfxMessageBox(tekst);<br />
}</small>


If i execute this i get a weird looking character(because i get a number with wParam), how can i send the CString towards my function?

me = Visual C++ n00b
GeneralRe: Send a message from a thread to a function with parameters Pin
Chris Meech5-Feb-03 1:25
Chris Meech5-Feb-03 1:25 
GeneralRe: Send a message from a thread to a function with parameters Pin
willempipi5-Feb-03 1:58
willempipi5-Feb-03 1:58 
GeneralRe: Send a message from a thread to a function with parameters Pin
HENDRIK R5-Feb-03 2:11
HENDRIK R5-Feb-03 2:11 
GeneralRe: Send a message from a thread to a function with parameters Pin
willempipi5-Feb-03 2:42
willempipi5-Feb-03 2:42 
GeneralRe: Send a message from a thread to a function with parameters Pin
HENDRIK R5-Feb-03 3:14
HENDRIK R5-Feb-03 3:14 
GeneralRe: Send a message from a thread to a function with parameters Pin
willempipi5-Feb-03 3:26
willempipi5-Feb-03 3:26 
GeneralRe: Send a message from a thread to a function with parameters Pin
Chris Meech5-Feb-03 2:19
Chris Meech5-Feb-03 2:19 
GeneralCheck Menu Items Pin
satyavasu5-Feb-03 0:46
satyavasu5-Feb-03 0:46 
GeneralRe: Check Menu Items Pin
Abbas_Riazi5-Feb-03 1:22
professionalAbbas_Riazi5-Feb-03 1:22 
QuestionHow many processor inside... Pin
Raphael Kindt5-Feb-03 0:46
Raphael Kindt5-Feb-03 0:46 
AnswerRe: How many processor inside... Pin
Mike Nordell5-Feb-03 0:53
Mike Nordell5-Feb-03 0:53 
GeneralRe: How many processor inside... Pin
Anders Molin5-Feb-03 1:16
professionalAnders Molin5-Feb-03 1:16 
AnswerRe: How many processor inside... Pin
Abbas_Riazi5-Feb-03 1:26
professionalAbbas_Riazi5-Feb-03 1:26 
General.exe from VC++ Pin
Anonymous5-Feb-03 0:35
Anonymous5-Feb-03 0:35 
GeneralRe: .exe from VC++ Pin
Abbas_Riazi5-Feb-03 0:39
professionalAbbas_Riazi5-Feb-03 0:39 
GeneralRe: .exe from VC++ Pin
Anonymous5-Feb-03 1:01
Anonymous5-Feb-03 1:01 
GeneralRe: .exe from VC++ Pin
Rage5-Feb-03 1:10
professionalRage5-Feb-03 1:10 

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.