help me please.
-
I want to know if there is any function like C function 'printf'. For example, I just want to draw a line of text in the view like that:you have typed a %s. in C ,I would do like that :printf("you have typed %s",str); but I could not the function can do like this way(I know there is a function ,TRACE,but it is not I need) in MFC,could anybody answer me? YES, I am here.
-
I want to know if there is any function like C function 'printf'. For example, I just want to draw a line of text in the view like that:you have typed a %s. in C ,I would do like that :printf("you have typed %s",str); but I could not the function can do like this way(I know there is a function ,TRACE,but it is not I need) in MFC,could anybody answer me? YES, I am here.
CString::Format(); - Anders Money talks, but all mine ever says is "Goodbye!"
-
I want to know if there is any function like C function 'printf'. For example, I just want to draw a line of text in the view like that:you have typed a %s. in C ,I would do like that :printf("you have typed %s",str); but I could not the function can do like this way(I know there is a function ,TRACE,but it is not I need) in MFC,could anybody answer me? YES, I am here.
CString.Format(wada wada wada) or sprintf(wada wada wada) then TextOut(blah blah blah) then apparently you will have an uncle called bob :cool:
situations to avoid #37:
"good morning ... how many sugars do you take in your coffee ... and what was your name again?"coming soon: situations to avoid #38: "...and the dog was there too?"
-
CString.Format(wada wada wada) or sprintf(wada wada wada) then TextOut(blah blah blah) then apparently you will have an uncle called bob :cool:
situations to avoid #37:
"good morning ... how many sugars do you take in your coffee ... and what was your name again?"coming soon: situations to avoid #38: "...and the dog was there too?"
-
The first two that Lauren mentioned will format the data in your string into another buffer, then you can use TextOut to draw to your view. You should place the call to TextOut in your OnDraw handler if you are using MFC, or in your handler for WM_PAINT if you are using regular window 32.
Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life! -
you would normally either let your user type directly into the view (like a text editor) or enter stuff thru a dialog box then in your OnPaint() handler you would put the other code :cool:
situations to avoid #37:
"good morning ... how many sugars do you take in your coffee ... and what was your name again?"coming soon: situations to avoid #38: "...and the dog was there too?"