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

C / C++ / MFC

 
GeneralRe: why pApplication.CreateInstance( _T("Excel.Application") ) FAILED? Pin
CPallini5-Dec-11 22:36
mveCPallini5-Dec-11 22:36 
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 
I just use the GetWindowTextLength and GetWindowText functions, something like this:

C++
case IDC_BTN_TEST:
    editWnd = GetDlgItem(hwndDlg, IDC_EDIT1);
    stringLength = GetWindowTextLength(editWnd);
    if (stringLength != 0)
    {
        strBuffer = new WCHAR[stringLength+2];
        GetWindowText(editWnd, strBuffer, stringLength+1);
        MessageBox(hwndDlg, strBuffer, L"title", MB_OK);
        delete strBuffer;
    }
    return TRUE;


For some reason, calling GetWindowText with stringLength (as opposed to stringLength+1) returns the string minus the last character... WTF | :WTF:
GeneralRe: win32 edit box, validating text Pin
Randor 5-Dec-11 17:37
professional Randor 5-Dec-11 17:37 
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 

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.