Click here to Skip to main content
15,887,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: why pApplication.CreateInstance( _T("Excel.Application") ) FAILED? Pin
Le@rner17-Jan-12 1:17
Le@rner17-Jan-12 1:17 
GeneralRe: why pApplication.CreateInstance( _T("Excel.Application") ) FAILED? Pin
CPallini17-Jan-12 1:36
mveCPallini17-Jan-12 1:36 
GeneralRe: why pApplication.CreateInstance( _T("Excel.Application") ) FAILED? Pin
Sampath57927-Aug-19 1:15
Sampath57927-Aug-19 1:15 
Questionwin32 edit box, validating text Pin
jkirkerx5-Dec-11 9:20
professionaljkirkerx5-Dec-11 9:20 
AnswerRe: win32 edit box, validating text Pin
David Crow5-Dec-11 10:52
David Crow5-Dec-11 10:52 
GeneralRe: win32 edit box, validating text Pin
jkirkerx6-Dec-11 6:46
professionaljkirkerx6-Dec-11 6:46 
AnswerRe: win32 edit box, validating text Pin
enhzflep5-Dec-11 17:21
enhzflep5-Dec-11 17:21 
GeneralRe: win32 edit box, validating text Pin
Randor 5-Dec-11 17:37
professional Randor 5-Dec-11 17:37 
enhzflep wrote:
For some reason, calling GetWindowText with stringLength (as opposed to stringLength+1) returns the string minus the last character... WTF | :WTF:


That is of course because 'C' strings are terminated with a NULL character. The GetWindowTextLength function sends the WM_GETTEXTLENGTH message[^] and therefore is returning only the length of the text excluding the NULL character. When allocating space for C-style strings you should always calculate the bytes required as:

((number of characters) * sizeof(TCHAR)) + sizeof(TCHAR)


Feel free to replace TCHAR with char or wchar_t dependent on your compiler/platform and ANSI/Unicode build.

Best Wishes,
-David Delaune
GeneralRe: win32 edit box, validating text Pin
jkirkerx6-Dec-11 7:00
professionaljkirkerx6-Dec-11 7:00 
QuestionPyramid of Asterisk - Reverse? Pin
Yolande MR5-Dec-11 8:34
Yolande MR5-Dec-11 8:34 
QuestionRe: Pyramid of Asterisk - Reverse? Pin
Albert Holguin5-Dec-11 8:41
professionalAlbert Holguin5-Dec-11 8:41 
AnswerRe: Pyramid of Asterisk - Reverse? Pin
Richard MacCutchan5-Dec-11 8:43
mveRichard MacCutchan5-Dec-11 8:43 
GeneralRe: Pyramid of Asterisk - Reverse? Pin
Yolande MR5-Dec-11 8:47
Yolande MR5-Dec-11 8:47 
AnswerRe: Pyramid of Asterisk - Reverse? Pin
User 74293385-Dec-11 8:55
professionalUser 74293385-Dec-11 8:55 
GeneralRe: Pyramid of Asterisk - Reverse? Pin
Stefan_Lang5-Dec-11 22:56
Stefan_Lang5-Dec-11 22:56 
GeneralRe: Pyramid of Asterisk - Reverse? Pin
User 74293386-Dec-11 5:17
professionalUser 74293386-Dec-11 5:17 
GeneralRe: Pyramid of Asterisk - Reverse? Pin
Stefan_Lang6-Dec-11 5:33
Stefan_Lang6-Dec-11 5:33 
GeneralRe: Pyramid of Asterisk - Reverse? Pin
Yolande MR5-Dec-11 9:17
Yolande MR5-Dec-11 9:17 
GeneralRe: Pyramid of Asterisk - Reverse? Pin
David Crow5-Dec-11 8:44
David Crow5-Dec-11 8:44 
GeneralRe: Pyramid of Asterisk - Reverse? Pin
Yolande MR5-Dec-11 8:49
Yolande MR5-Dec-11 8:49 
QuestionRe: Pyramid of Asterisk - Reverse? Pin
David Crow5-Dec-11 9:04
David Crow5-Dec-11 9:04 
AnswerRe: Pyramid of Asterisk - Reverse? Pin
User 74293385-Dec-11 8:45
professionalUser 74293385-Dec-11 8:45 
GeneralRe: Pyramid of Asterisk - Reverse? Pin
Yolande MR5-Dec-11 9:11
Yolande MR5-Dec-11 9:11 
GeneralRe: Pyramid of Asterisk - Reverse? Pin
User 74293385-Dec-11 9:40
professionalUser 74293385-Dec-11 9:40 
QuestionObject instance error? Help Pin
ottini935-Dec-11 2:49
ottini935-Dec-11 2:49 

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.