Click here to Skip to main content
15,886,622 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
I have this code:

C++
LRESULT CMFCApplication7Dlg::OnCustom(WPARAM wparam, LPARAM lparam)
{
	CString* pstr = (CString*)wparam;

	testo.SetWindowText(_T(*pstr));
	
		return 0;
}



so in my dialog I receive string from an other dialog, I want to write received string in an edit, but I have an error

What I have tried:

I tried to use pointer but I don't understand how I can get the string
Posted
Updated 3-Oct-19 4:06am

1 solution

I solved, I mistake to put _T...it's this the problem
 
Share this answer
 
Comments
Richard MacCutchan 3-Oct-19 10:30am    
You cannot use the _T macro on a pointer.
Leo Chapiro 4-Oct-19 5:34am    
Richard, _T(*pstr) uses not a pointer but de-referenced it in contrast to _T(pstr) what you probably mean.
Richard MacCutchan 4-Oct-19 8:57am    
No, I mean that you cannot use the _T macro on a pointer; or a variable reference. It only works on constant characters or strings.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900