Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: binary trees Pin
Amr.Mohammad8724-Dec-15 20:14
Amr.Mohammad8724-Dec-15 20:14 
GeneralRe: binary trees Pin
CPallini25-Dec-15 8:43
mveCPallini25-Dec-15 8:43 
QuestionService only works once useing Pin
derek-20084-Dec-15 12:58
derek-20084-Dec-15 12:58 
QuestionAdding a new button to and existing CMFCRibbonBar "tab" Pin
S.T.K4-Dec-15 6:22
S.T.K4-Dec-15 6:22 
GeneralRe: I now have an MFC example project that highlights my issue. Pin
S.T.K6-Dec-15 23:25
S.T.K6-Dec-15 23:25 
GeneralRe: Adding a new button to and existing CMFCRibbonBar "tab" Pin
S.T.K10-Dec-15 2:37
S.T.K10-Dec-15 2:37 
AnswerRe: Adding a new button to and existing CMFCRibbonBar "tab" Pin
S.T.K17-Dec-15 23:55
S.T.K17-Dec-15 23:55 
QuestionC++ - Accessibility of object after deletion. (illegal still working), why this is happening? Pin
Satish Shankar Jagtap3-Dec-15 23:54
Satish Shankar Jagtap3-Dec-15 23:54 
AnswerRe: C++ - Accessibility of object after deletion. (illegal still working), why this is happening? Pin
CPallini4-Dec-15 0:17
mveCPallini4-Dec-15 0:17 
AnswerRe: C++ - Accessibility of object after deletion. (illegal still working), why this is happening? Pin
Jochen Arndt4-Dec-15 1:45
professionalJochen Arndt4-Dec-15 1:45 
GeneralRe: C++ - Accessibility of object after deletion. (illegal still working), why this is happening? Pin
CPallini4-Dec-15 9:18
mveCPallini4-Dec-15 9:18 
QuestionFloating point conversion Pin
Still learning how to code3-Dec-15 22:19
Still learning how to code3-Dec-15 22:19 
AnswerRe: Floating point conversion Pin
Michael_Davies3-Dec-15 22:29
Michael_Davies3-Dec-15 22:29 
GeneralRe: Floating point conversion Pin
Richard MacCutchan3-Dec-15 22:40
mveRichard MacCutchan3-Dec-15 22:40 
GeneralRe: Floating point conversion Pin
Michael_Davies4-Dec-15 21:08
Michael_Davies4-Dec-15 21:08 
GeneralRe: Floating point conversion Pin
Richard MacCutchan4-Dec-15 22:12
mveRichard MacCutchan4-Dec-15 22:12 
AnswerRe: Floating point conversion Pin
Richard MacCutchan3-Dec-15 22:39
mveRichard MacCutchan3-Dec-15 22:39 
AnswerRe: Floating point conversion Pin
Jochen Arndt3-Dec-15 23:10
professionalJochen Arndt3-Dec-15 23:10 
GeneralRe: Floating point conversion Pin
Still learning how to code5-Dec-15 0:29
Still learning how to code5-Dec-15 0:29 
AnswerRe: Floating point conversion Pin
CPallini3-Dec-15 23:30
mveCPallini3-Dec-15 23:30 
GeneralRe: Floating point conversion Pin
k50544-Dec-15 4:21
mvek50544-Dec-15 4:21 
QuestionIEEE 754-1985 Pin
enhzflep4-Dec-15 5:43
enhzflep4-Dec-15 5:43 
AnswerRe: Floating point conversion Pin
S.T.K8-Dec-15 3:19
S.T.K8-Dec-15 3:19 
QuestionComboboxx issue in MFC Pin
Amrit Agr3-Dec-15 2:48
Amrit Agr3-Dec-15 2:48 
I have a combobox in a mfc application. I created it at runtime with following code -
if (!m_sortBox.Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST, rect, this, eSortBox))

return FALSE;

Now the requirements, if user is selecting an item from combobox like , if combo box have focus & user is pressing up/down arrow key, it should NOT update the data.
If user is pressing enter key after selecting a item, it should update data.

So i didn't handled OnSelchange here.

For enter key requirement, I checked enter key event in preTranslateMsg & checking if combo box have focus, it should trigger the function, who will eventually update the data.
if (pMsg->message == WM_CHAR && pMsg->wParam == VK_RETURN)
{
CWnd pActiveWnd = CWnd::FromHandle(GetFocus()->GetSafeHwnd());
CWnd
pcbSortBoxWnd = CWnd::FromHandle(m_sortBox.GetSafeHwnd());
    //If sort combo box has focus and user press Enter key, it should trigger OnComboSelChange event
    //Eventually it will update the data.
    if (pcbSortBoxWnd == pActiveWnd)
        OnSortChange();

}

I also handled ON_CBN_CLOSEUP(eSortBox, OnSortChange)
So that mouse functionality will work(because with mouse, data should get update)

Now my logic is working but its crashing in some cases.
Like - If I press Alt + Down arrow key, which will expand combobox, I select an item(with help of arrow keys) and press enter.

Sometimes its getting crash.

please help me out.

Regards,
Amrit Agrawal
SuggestionRe: Comboboxx issue in MFC Pin
Richard MacCutchan3-Dec-15 3:50
mveRichard MacCutchan3-Dec-15 3:50 

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.