Click here to Skip to main content
15,892,480 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to pass size of an array from command line Pin
CPallini7-Dec-17 3:19
mveCPallini7-Dec-17 3:19 
QuestionCEdit::LineLength returning zero Pin
ForNow6-Dec-17 13:16
ForNow6-Dec-17 13:16 
AnswerRe: CEdit::LineLength returning zero Pin
Rick York6-Dec-17 14:41
mveRick York6-Dec-17 14:41 
Did you pass a valid line number to it like 0? If you pass it -1 "the return value is the number of unselected characters in the lines that contain selected characters" according to the documentation.

You will have to do the length limiting of each line yourself because LimitText and SetLimitText define how many total characters the control can accept, not just on one line.

Also, to get the number of pixels per character you should call GetTextExtent which is a member of the CDC class. The typical way is to generate a string with all upper and lower case letters, call GetTextExtent with that string, and then divide the resulting width by the string length to get an average for each character. There are lots of examples that show how to do this.
GeneralRe: CEdit::LineLength returning zero Pin
ForNow6-Dec-17 15:51
ForNow6-Dec-17 15:51 
GeneralRe: CEdit::LineLength returning zero Pin
Rick York6-Dec-17 19:00
mveRick York6-Dec-17 19:00 
GeneralRe: CEdit::LineLength returning zero Pin
ForNow6-Dec-17 20:39
ForNow6-Dec-17 20:39 
QuestionRe: CEdit::LineLength returning zero Pin
Richard MacCutchan6-Dec-17 22:14
mveRichard MacCutchan6-Dec-17 22:14 
AnswerRe: CEdit::LineLength returning zero Pin
ForNow6-Dec-17 23:49
ForNow6-Dec-17 23:49 
GeneralRe: CEdit::LineLength returning zero Pin
Victor Nijegorodov7-Dec-17 0:39
Victor Nijegorodov7-Dec-17 0:39 
GeneralRe: CEdit::LineLength returning zero Pin
ForNow7-Dec-17 1:53
ForNow7-Dec-17 1:53 
GeneralRe: CEdit::LineLength returning zero Pin
Victor Nijegorodov7-Dec-17 8:40
Victor Nijegorodov7-Dec-17 8:40 
GeneralRe: CEdit::LineLength returning zero Pin
ForNow7-Dec-17 8:51
ForNow7-Dec-17 8:51 
GeneralRe: CEdit::LineLength returning zero Pin
Richard MacCutchan7-Dec-17 22:16
mveRichard MacCutchan7-Dec-17 22:16 
SuggestionRe: CEdit::LineLength returning zero Pin
David Crow7-Dec-17 9:47
David Crow7-Dec-17 9:47 
GeneralRe: CEdit::LineLength returning zero Pin
ForNow7-Dec-17 9:55
ForNow7-Dec-17 9:55 
GeneralRe: CEdit::LineLength returning zero The Answer is CMFCMaskEdit Class Pin
ForNow8-Dec-17 7:48
ForNow8-Dec-17 7:48 
QuestionCalling DLL method from multi-thread Pin
shakumar_215-Dec-17 23:23
shakumar_215-Dec-17 23:23 
QuestionRe: Calling DLL method from multi-thread Pin
Richard MacCutchan5-Dec-17 23:54
mveRichard MacCutchan5-Dec-17 23:54 
AnswerRe: Calling DLL method from multi-thread Pin
Victor Nijegorodov6-Dec-17 8:23
Victor Nijegorodov6-Dec-17 8:23 
QuestionWhy -nan values appear Pin
User 135094504-Dec-17 6:49
professionalUser 135094504-Dec-17 6:49 
AnswerRe: Why -nan values appear Pin
Jochen Arndt4-Dec-17 7:01
professionalJochen Arndt4-Dec-17 7:01 
AnswerRe: Why -nan values appear Pin
k50544-Dec-17 7:05
mvek50544-Dec-17 7:05 
GeneralRe: Why -nan values appear Pin
Peter_in_27805-Dec-17 12:50
professionalPeter_in_27805-Dec-17 12:50 
AnswerRe: Why -nan values appear Pin
David Crow4-Dec-17 8:58
David Crow4-Dec-17 8:58 
AnswerRe: Why -nan values appear Pin
CPallini4-Dec-17 22:26
mveCPallini4-Dec-17 22:26 

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.