Click here to Skip to main content
15,922,894 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Ensuring code runs synchronously Pin
Bram van Kampen9-Mar-16 14:29
Bram van Kampen9-Mar-16 14:29 
AnswerRe: Ensuring code runs synchronously Pin
Bram van Kampen9-Mar-16 15:04
Bram van Kampen9-Mar-16 15:04 
QuestionNon display characters for selection count Pin
ForNow8-Mar-16 19:44
ForNow8-Mar-16 19:44 
AnswerRe: Non display characters for selection count Pin
Richard MacCutchan8-Mar-16 21:45
mveRichard MacCutchan8-Mar-16 21:45 
GeneralRe: Non display characters for selection count Pin
ForNow9-Mar-16 3:55
ForNow9-Mar-16 3:55 
GeneralRe: Non display characters for selection count Pin
David Crow9-Mar-16 4:24
David Crow9-Mar-16 4:24 
GeneralRe: Non display characters for selection count Pin
ForNow9-Mar-16 4:32
ForNow9-Mar-16 4:32 
QuestionRe: Non display characters for selection count Pin
David Crow9-Mar-16 4:49
David Crow9-Mar-16 4:49 
AnswerRe: Non display characters for selection count Pin
ForNow9-Mar-16 4:58
ForNow9-Mar-16 4:58 
QuestionRe: Non display characters for selection count Pin
David Crow9-Mar-16 5:03
David Crow9-Mar-16 5:03 
AnswerRe: Non display characters for selection count Pin
ForNow9-Mar-16 5:20
ForNow9-Mar-16 5:20 
GeneralRe: Non display characters for selection count Pin
David Crow9-Mar-16 5:40
David Crow9-Mar-16 5:40 
GeneralRe: Non display characters for selection count Pin
ForNow9-Mar-16 5:45
ForNow9-Mar-16 5:45 
QuestionRe: Non display characters for selection count Pin
David Crow9-Mar-16 5:53
David Crow9-Mar-16 5:53 
AnswerRe: Non display characters for selection count Pin
ForNow9-Mar-16 6:21
ForNow9-Mar-16 6:21 
GeneralRe: Non display characters for selection count Pin
Richard MacCutchan9-Mar-16 6:18
mveRichard MacCutchan9-Mar-16 6:18 
GeneralRe: Non display characters for selection count Pin
Bram van Kampen9-Mar-16 14:52
Bram van Kampen9-Mar-16 14:52 
GeneralRe: Non display characters for selection count Pin
Richard MacCutchan9-Mar-16 22:11
mveRichard MacCutchan9-Mar-16 22:11 
GeneralRe: Non display characters for selection count Pin
Bram van Kampen9-Mar-16 14:49
Bram van Kampen9-Mar-16 14:49 
GeneralRe: Non display characters for selection count Pin
Richard MacCutchan9-Mar-16 22:11
mveRichard MacCutchan9-Mar-16 22:11 
GeneralRe: Non display characters for selection count Pin
Bram van Kampen10-Mar-16 14:19
Bram van Kampen10-Mar-16 14:19 
QuestionRe: Non display characters for selection count Pin
David Crow10-Mar-16 2:48
David Crow10-Mar-16 2:48 
AnswerRe: Non display characters for selection count Pin
leon de boer15-Mar-16 20:22
leon de boer15-Mar-16 20:22 
EM_GETSELTEXT is explicit
C#
This message returns the number of characters copied, not including the terminating null character.

The call is terminated by the null character and if you have CR,LF they will count as characters
The return is a CHARACTER COUNT, if your edit box is unicode mode it still reflects the character NOT THE NUMBER OF BYTES.

Hence when providing a buffer you are best to use an array of TCHAR rather than a standard byte array to allow for size difference.

Also note when size a TCHAR array use _countof DO NOT use sizeof for the same reason. Standard unicode aware coding practice.

Several of the comments have confusion between CHARACTER and BYTE within the meaning of the windows API. No such confusion exists.
In vino veritas


modified 16-Mar-16 2:46am.

Questionconfused in static member function of class. Pin
Member 87269408-Mar-16 19:01
Member 87269408-Mar-16 19:01 
AnswerRe: confused in static member function of class. Pin
Richard MacCutchan8-Mar-16 21:37
mveRichard MacCutchan8-Mar-16 21:37 

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.