Click here to Skip to main content
14,698,679 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Non display characters for selection count Pin
Richard MacCutchan9-Mar-16 7:18
mveRichard MacCutchan9-Mar-16 7:18 
GeneralRe: Non display characters for selection count Pin
Bram van Kampen9-Mar-16 15:52
MemberBram van Kampen9-Mar-16 15:52 
GeneralRe: Non display characters for selection count Pin
Richard MacCutchan9-Mar-16 23:11
mveRichard MacCutchan9-Mar-16 23:11 
GeneralRe: Non display characters for selection count Pin
Bram van Kampen9-Mar-16 15:49
MemberBram van Kampen9-Mar-16 15:49 
GeneralRe: Non display characters for selection count Pin
Richard MacCutchan9-Mar-16 23:11
mveRichard MacCutchan9-Mar-16 23:11 
GeneralRe: Non display characters for selection count Pin
Bram van Kampen10-Mar-16 15:19
MemberBram van Kampen10-Mar-16 15:19 
QuestionRe: Non display characters for selection count Pin
David Crow10-Mar-16 3:48
MemberDavid Crow10-Mar-16 3:48 
AnswerRe: Non display characters for selection count Pin
leon de boer15-Mar-16 21:22
Memberleon de boer15-Mar-16 21:22 
EM_GETSELTEXT is explicit
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 20:01
MemberMember 87269408-Mar-16 20:01 
AnswerRe: confused in static member function of class. Pin
Richard MacCutchan8-Mar-16 22:37
mveRichard MacCutchan8-Mar-16 22:37 
GeneralRe: confused in static member function of class. Pin
Member 872694014-Mar-16 20:19
MemberMember 872694014-Mar-16 20:19 
QuestionAssertion failure While Editing CTreeView Label. Pin
shanmugarajaa8-Mar-16 10:04
Membershanmugarajaa8-Mar-16 10:04 
QuestionRe: Assertion failure While Editing CTreeView Label. Pin
jeron18-Mar-16 10:43
Memberjeron18-Mar-16 10:43 
QuestionRe: Assertion failure While Editing CTreeView Label. Pin
David Crow8-Mar-16 17:41
MemberDavid Crow8-Mar-16 17:41 
AnswerRe: Assertion failure While Editing CTreeView Label. Pin
_Flaviu8-Mar-16 21:37
Member_Flaviu8-Mar-16 21:37 
QuestionApplication crashes on calling OnPaint() function!? Pin
Kiran Satish7-Mar-16 17:51
MemberKiran Satish7-Mar-16 17:51 
AnswerRe: Application crashes on calling OnPaint() function!? Pin
Richard MacCutchan7-Mar-16 22:59
mveRichard MacCutchan7-Mar-16 22:59 
GeneralRe: Application crashes on calling OnPaint() function!? Pin
Kiran Satish8-Mar-16 4:40
MemberKiran Satish8-Mar-16 4:40 
GeneralRe: Application crashes on calling OnPaint() function!? Pin
Richard MacCutchan8-Mar-16 6:53
mveRichard MacCutchan8-Mar-16 6:53 
SuggestionRe: Application crashes on calling OnPaint() function!? Pin
David Crow8-Mar-16 4:40
MemberDavid Crow8-Mar-16 4:40 
GeneralRe: Application crashes on calling OnPaint() function!? Pin
Kiran Satish8-Mar-16 5:31
MemberKiran Satish8-Mar-16 5:31 
Questionhow execute query in access database with CRecordset file? Pin
Le@rner4-Mar-16 19:05
MemberLe@rner4-Mar-16 19:05 
AnswerRe: how execute query in access database with CRecordset file? Pin
Victor Nijegorodov5-Mar-16 5:51
MemberVictor Nijegorodov5-Mar-16 5:51 
QuestionRe: how execute query in access database with CRecordset file? Pin
David Crow5-Mar-16 17:55
MemberDavid Crow5-Mar-16 17:55 
QuestionAT command serially via C code Pin
Member 123621671-Mar-16 7:57
MemberMember 123621671-Mar-16 7:57 

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.