Click here to Skip to main content
15,850,359 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General[C++ Error] exception(15): E2141 Declaration syntax error Pin
gordon305611-Sep-09 9:04
gordon305611-Sep-09 9:04 
GeneralRe: [C++ Error] exception(15): E2141 Declaration syntax error Pin
Maximilien11-Sep-09 9:02
Maximilien11-Sep-09 9:02 
GeneralRe: [C++ Error] exception(15): E2141 Declaration syntax error Pin
Nemanja Trifunovic11-Sep-09 9:06
Nemanja Trifunovic11-Sep-09 9:06 
GeneralThanks to all concerned somehow I got my source labeled variable.cpp.c Pin
gordon305611-Sep-09 9:20
gordon305611-Sep-09 9:20 
GeneralRe: Thanks to all concerned somehow I got my source labeled variable.cpp.c Pin
Nemanja Trifunovic11-Sep-09 9:48
Nemanja Trifunovic11-Sep-09 9:48 
GeneralRe: [C++ Error] exception(15): E2141 Declaration syntax error Pin
UKM_Student11-Sep-09 9:11
UKM_Student11-Sep-09 9:11 
GeneralThanks UKM_Student I'm looking at code blocks right now Pin
gordon305611-Sep-09 9:37
gordon305611-Sep-09 9:37 
QuestionOdd bug in CMFCToolbarComboBoxButton class Pin
Santanu Lahiri11-Sep-09 6:17
Santanu Lahiri11-Sep-09 6:17 
Hello,

I am trying to use this control in a toolbar. For the most part the code works. However, I am running into this odd problem that I am getting partial text back when I call GetText.

The app requires that when I click a different button in the toolbar, I check the combo box and retrieve the text from it for processing. That is when this bug surfaces. The last character is getting truncated. If I retrieve the text in response to the Enter key handler for the combo box, I get the full text using the same GetText call.

Here is the code...most all of it is lifted from the samples.

CObList listButtons;
if (CMFCToolBar::GetCommandButtons(ID_EDT_FIND_NDC, listButtons) > 0)
{
    for (POSITION posCombo = listButtons.GetHeadPosition();
    pSrcCombo == NULL && posCombo != NULL; )
    {
       CMFCToolBarComboBoxButton* pCombo = DYNAMIC_DOWNCAST(CMFCToolBarComboBoxButton, listButtons.GetNext(posCombo));
       if (pCombo != NULL) pSrcCombo = pCombo;
    }
}

if (pSrcCombo != NULL)
{
ASSERT_VALID(pSrcCombo);

LPCTSTR lpszSelItem = pSrcCombo->GetText();
...
}

So if the combo box has the text '1234567890', I am getting back '123456789' in one case, and '1234567890' in another case, depending on whether I press the other button or press the Enter key.

Has anyone encountered this, and can someone suggest a solution?

Thanks for your time.
AnswerRe: Odd bug in CMFCToolbarComboBoxButton class Pin
PatrikE20-Oct-09 5:42
PatrikE20-Oct-09 5:42 
GeneralRe: Odd bug in CMFCToolbarComboBoxButton class [modified] Pin
Santanu Lahiri20-Oct-09 11:00
Santanu Lahiri20-Oct-09 11:00 
AnswerSOLUTION!!: Odd bug in CMFCToolbarComboBoxButton class Pin
PatrikE20-Oct-09 6:27
PatrikE20-Oct-09 6:27 
GeneralRe: SOLUTION!!: Odd bug in CMFCToolbarComboBoxButton class Pin
Santanu Lahiri20-Oct-09 11:07
Santanu Lahiri20-Oct-09 11:07 
QuestionHow to unlock locked file using Win32 API? [modified] Pin
JoeSchmoe00711-Sep-09 5:55
JoeSchmoe00711-Sep-09 5:55 
QuestionRe: How to unlock locked file using Win32 API? Pin
David Crow11-Sep-09 6:17
David Crow11-Sep-09 6:17 
AnswerFile is still locked after application is shut down. Pin
JoeSchmoe00711-Sep-09 6:30
JoeSchmoe00711-Sep-09 6:30 
GeneralRe: File is still locked after application is shut down. Pin
David Crow11-Sep-09 6:58
David Crow11-Sep-09 6:58 
GeneralRe: File is still locked after application is shut down. Pin
Nemanja Trifunovic11-Sep-09 9:08
Nemanja Trifunovic11-Sep-09 9:08 
AnswerRe: How to unlock locked file using Win32 API? Pin
Stuart Dootson11-Sep-09 22:37
professionalStuart Dootson11-Sep-09 22:37 
AnswerRe: How to unlock locked file using Win32 API? Pin
kilt14-Sep-09 3:21
kilt14-Sep-09 3:21 
QuestionBeginner's Question 2 Pin
UKM_Student11-Sep-09 5:37
UKM_Student11-Sep-09 5:37 
AnswerRe: Beginner's Question 2 Pin
David Crow11-Sep-09 5:41
David Crow11-Sep-09 5:41 
GeneralRe: Beginner's Question 2 Pin
UKM_Student11-Sep-09 5:44
UKM_Student11-Sep-09 5:44 
GeneralRe: Beginner's Question 2 Pin
David Crow11-Sep-09 5:48
David Crow11-Sep-09 5:48 
GeneralRe: Beginner's Question 2 Pin
UKM_Student11-Sep-09 5:56
UKM_Student11-Sep-09 5:56 
GeneralRe: Beginner's Question 2 Pin
UKM_Student11-Sep-09 5:55
UKM_Student11-Sep-09 5:55 

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.