Click here to Skip to main content
15,794,593 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem displaying CStatic text item Pin
ForNow30-Jun-15 11:38
ForNow30-Jun-15 11:38 
GeneralRe: Problem displaying CStatic text item Pin
jeron130-Jun-15 12:41
jeron130-Jun-15 12:41 
GeneralRe: Problem displaying CStatic text item Pin
ForNow30-Jun-15 12:57
ForNow30-Jun-15 12:57 
GeneralRe: Problem displaying CStatic text item Pin
jeron130-Jun-15 13:16
jeron130-Jun-15 13:16 
GeneralRe: Problem displaying CStatic text item Pin
ForNow30-Jun-15 13:49
ForNow30-Jun-15 13:49 
GeneralOne more thing forgot Pin
ForNow30-Jun-15 13:58
ForNow30-Jun-15 13:58 
GeneralRe: One more thing forgot Pin
Richard MacCutchan1-Jul-15 1:22
mveRichard MacCutchan1-Jul-15 1:22 
AnswerRe: Problem displaying CStatic text item Pin
David Crow30-Jun-15 17:43
David Crow30-Jun-15 17:43 
ForNow wrote:
I have a CStatic ptr says
CStatic *mytext
Why use a pointer? Just add:
CStatic mytext;

to your dialog's header file. Add an entry to your dialog's DoDataExchange() method like:
DDX_Control(pDX, IDC_MYTEXT, mytext);

Then in your dialog's OnInitDialog() method, set the control's text like:
mytext.SetWindowText(_T("Hello World"));

And that's it! No need for pointers, memory allocation, or messy calls to UpdateData().

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles


GeneralRe: Problem displaying CStatic text item Pin
ForNow30-Jun-15 18:06
ForNow30-Jun-15 18:06 
AnswerRe: Problem displaying CStatic text item Pin
David Crow1-Jul-15 3:03
David Crow1-Jul-15 3:03 
GeneralRe: Problem displaying CStatic text item Pin
ForNow1-Jul-15 4:36
ForNow1-Jul-15 4:36 
GeneralRe: Problem displaying CStatic text item Pin
David Crow1-Jul-15 4:41
David Crow1-Jul-15 4:41 
GeneralRe: Problem displaying CStatic text item Pin
jeron11-Jul-15 5:04
jeron11-Jul-15 5:04 
GeneralRe: Problem displaying CStatic text item Pin
ForNow1-Jul-15 6:19
ForNow1-Jul-15 6:19 
GeneralRe: Problem displaying CStatic text item Pin
jeron11-Jul-15 6:59
jeron11-Jul-15 6:59 
GeneralRe: Problem displaying CStatic text item Pin
ForNow1-Jul-15 11:21
ForNow1-Jul-15 11:21 
GeneralRe: Problem displaying CStatic text item Pin
jeron11-Jul-15 12:32
jeron11-Jul-15 12:32 
GeneralRe: Problem displaying CStatic text item Pin
ForNow1-Jul-15 13:19
ForNow1-Jul-15 13:19 
GeneralRe: Problem displaying CStatic text item Pin
ForNow2-Jul-15 14:27
ForNow2-Jul-15 14:27 
Questionrecv no blocking Pin
mosine29-Jun-15 22:33
mosine29-Jun-15 22:33 
AnswerRe: recv no blocking Pin
CPallini29-Jun-15 22:54
mveCPallini29-Jun-15 22:54 
GeneralRe: recv no blocking Pin
mosine29-Jun-15 23:21
mosine29-Jun-15 23:21 
GeneralRe: recv no blocking Pin
CPallini29-Jun-15 23:35
mveCPallini29-Jun-15 23:35 
GeneralRe: recv no blocking Pin
mosine29-Jun-15 23:52
mosine29-Jun-15 23:52 
GeneralRe: recv no blocking Pin
CPallini30-Jun-15 0:01
mveCPallini30-Jun-15 0:01 

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.