Click here to Skip to main content
15,886,787 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General[C++ Error] exception(15): E2141 Declaration syntax error Pin
gordon305611-Sep-09 8:04
gordon305611-Sep-09 8:04 
GeneralRe: [C++ Error] exception(15): E2141 Declaration syntax error Pin
Maximilien11-Sep-09 8:02
Maximilien11-Sep-09 8:02 
GeneralRe: [C++ Error] exception(15): E2141 Declaration syntax error Pin
Nemanja Trifunovic11-Sep-09 8:06
Nemanja Trifunovic11-Sep-09 8:06 
GeneralThanks to all concerned somehow I got my source labeled variable.cpp.c Pin
gordon305611-Sep-09 8:20
gordon305611-Sep-09 8:20 
GeneralRe: Thanks to all concerned somehow I got my source labeled variable.cpp.c Pin
Nemanja Trifunovic11-Sep-09 8:48
Nemanja Trifunovic11-Sep-09 8:48 
GeneralRe: [C++ Error] exception(15): E2141 Declaration syntax error Pin
UKM_Student11-Sep-09 8:11
UKM_Student11-Sep-09 8:11 
GeneralThanks UKM_Student I'm looking at code blocks right now Pin
gordon305611-Sep-09 8:37
gordon305611-Sep-09 8:37 
QuestionOdd bug in CMFCToolbarComboBoxButton class Pin
Santanu Lahiri11-Sep-09 5:17
Santanu Lahiri11-Sep-09 5: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 4:42
PatrikE20-Oct-09 4:42 
GeneralRe: Odd bug in CMFCToolbarComboBoxButton class [modified] Pin
Santanu Lahiri20-Oct-09 10:00
Santanu Lahiri20-Oct-09 10:00 
AnswerSOLUTION!!: Odd bug in CMFCToolbarComboBoxButton class Pin
PatrikE20-Oct-09 5:27
PatrikE20-Oct-09 5:27 
GeneralRe: SOLUTION!!: Odd bug in CMFCToolbarComboBoxButton class Pin
Santanu Lahiri20-Oct-09 10:07
Santanu Lahiri20-Oct-09 10:07 
QuestionHow to unlock locked file using Win32 API? [modified] Pin
JoeSchmoe00711-Sep-09 4:55
JoeSchmoe00711-Sep-09 4:55 
QuestionRe: How to unlock locked file using Win32 API? Pin
David Crow11-Sep-09 5:17
David Crow11-Sep-09 5:17 
AnswerFile is still locked after application is shut down. Pin
JoeSchmoe00711-Sep-09 5:30
JoeSchmoe00711-Sep-09 5:30 
GeneralRe: File is still locked after application is shut down. Pin
David Crow11-Sep-09 5:58
David Crow11-Sep-09 5:58 
GeneralRe: File is still locked after application is shut down. Pin
Nemanja Trifunovic11-Sep-09 8:08
Nemanja Trifunovic11-Sep-09 8:08 
AnswerRe: How to unlock locked file using Win32 API? Pin
Stuart Dootson11-Sep-09 21:37
professionalStuart Dootson11-Sep-09 21:37 
AnswerRe: How to unlock locked file using Win32 API? Pin
kilt14-Sep-09 2:21
kilt14-Sep-09 2:21 
QuestionBeginner's Question 2 Pin
UKM_Student11-Sep-09 4:37
UKM_Student11-Sep-09 4:37 
AnswerRe: Beginner's Question 2 Pin
David Crow11-Sep-09 4:41
David Crow11-Sep-09 4:41 
GeneralRe: Beginner's Question 2 Pin
UKM_Student11-Sep-09 4:44
UKM_Student11-Sep-09 4:44 
GeneralRe: Beginner's Question 2 Pin
David Crow11-Sep-09 4:48
David Crow11-Sep-09 4:48 
GeneralRe: Beginner's Question 2 Pin
UKM_Student11-Sep-09 4:56
UKM_Student11-Sep-09 4:56 
GeneralRe: Beginner's Question 2 Pin
UKM_Student11-Sep-09 4:55
UKM_Student11-Sep-09 4: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.