Click here to Skip to main content
15,901,426 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OnSize() gets called only once Pin
zengkun1008-Jan-08 23:03
zengkun1008-Jan-08 23:03 
GeneralRe: OnSize() gets called only once Pin
David Crow9-Jan-08 3:43
David Crow9-Jan-08 3:43 
GeneralUse ostringstream to make a string Pin
CodingLover8-Jan-08 19:54
CodingLover8-Jan-08 19:54 
GeneralRe: Use ostringstream to make a string Pin
toxcct8-Jan-08 21:22
toxcct8-Jan-08 21:22 
GeneralRe: Use ostringstream to make a string Pin
CodingLover8-Jan-08 21:53
CodingLover8-Jan-08 21:53 
GeneralRe: Use ostringstream to make a string [modified] Pin
CPallini8-Jan-08 22:06
mveCPallini8-Jan-08 22:06 
GeneralRe: Use ostringstream to make a string Pin
CodingLover8-Jan-08 22:26
CodingLover8-Jan-08 22:26 
QuestionA question about SendMessage and PostMessage Pin
zengkun1008-Jan-08 19:50
zengkun1008-Jan-08 19:50 
Is it memory safe to use SendMessage(PostMessage) to pass parameters between threads?

There are two threads A and B;
// thread A want to send some message to thread B
code sample about thread A:
{<br />
	char sz[] = "Hello, CodeProject";<br />
	BOOL b = TRUE;<br />
	SendMessage(hWnd, WM_SOMEMESSAGE, (WPARAM)sz, (LPRARM)b);<br />
	//or PostMessage(hWnd, WM_SOMEMESSAGE, (WPARAM)sz, 0);<br />
}<br />

Can I write code like this in thread B to retriecve the message?
{<br />
	MSG msg<br />
	GetMessage(&msg, hWnd, 0, 0);<br />
	char* p = (char*)(msg.wParam)<br />
	BOOL b = (BOOL)(msg.lParam)<br />
	cout<<p<<endl;	// can I get "Hello, CodeProject"?<br />
}



Thank you for your reply. Smile | :)
GeneralRe: A question about SendMessage and PostMessage Pin
Cedric Moonen8-Jan-08 20:11
Cedric Moonen8-Jan-08 20:11 
GeneralRe: A question about SendMessage and PostMessage Pin
zengkun1008-Jan-08 20:28
zengkun1008-Jan-08 20:28 
GeneralRe: A question about SendMessage and PostMessage Pin
Cedric Moonen8-Jan-08 20:34
Cedric Moonen8-Jan-08 20:34 
GeneralRe: A question about SendMessage and PostMessage Pin
zengkun1008-Jan-08 20:50
zengkun1008-Jan-08 20:50 
GeneralRe: A question about SendMessage and PostMessage Pin
Cedric Moonen8-Jan-08 20:59
Cedric Moonen8-Jan-08 20:59 
GeneralRe: A question about SendMessage and PostMessage Pin
zengkun1008-Jan-08 21:22
zengkun1008-Jan-08 21:22 
GeneralRe: A question about SendMessage and PostMessage Pin
CPallini8-Jan-08 21:41
mveCPallini8-Jan-08 21:41 
GeneralRe: A question about SendMessage and PostMessage Pin
zengkun1009-Jan-08 3:17
zengkun1009-Jan-08 3:17 
GeneralYou're welcome Pin
CPallini9-Jan-08 3:28
mveCPallini9-Jan-08 3:28 
GeneralRe: A question about SendMessage and PostMessage Pin
KarstenK8-Jan-08 21:34
mveKarstenK8-Jan-08 21:34 
Questionvoice communication, compress and recod question & c++ code for capture all thing i enter [modified] Pin
Member 45422728-Jan-08 19:10
Member 45422728-Jan-08 19:10 
GeneralRe: voice communication, compress and recod question & c++ code for capture all thing i enter Pin
Mark Salsbery9-Jan-08 7:25
Mark Salsbery9-Jan-08 7:25 
GeneralBitmap problem Pin
trioum8-Jan-08 18:59
trioum8-Jan-08 18:59 
GeneralRe: Bitmap problem Pin
Nishad S8-Jan-08 19:14
Nishad S8-Jan-08 19:14 
GeneralRe: Bitmap problem Pin
trioum8-Jan-08 19:19
trioum8-Jan-08 19:19 
GeneralRe: Bitmap problem Pin
Nishad S8-Jan-08 19:48
Nishad S8-Jan-08 19:48 
GeneralRe: Bitmap problem Pin
trioum8-Jan-08 21:24
trioum8-Jan-08 21:24 

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.