Click here to Skip to main content
14,741,395 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Floating point conversion Pin
Richard MacCutchan3-Dec-15 23:39
mveRichard MacCutchan3-Dec-15 23:39 
AnswerRe: Floating point conversion Pin
Jochen Arndt4-Dec-15 0:10
professionalJochen Arndt4-Dec-15 0:10 
GeneralRe: Floating point conversion Pin
Still learning how to code5-Dec-15 1:29
MemberStill learning how to code5-Dec-15 1:29 
AnswerRe: Floating point conversion Pin
CPallini4-Dec-15 0:30
mveCPallini4-Dec-15 0:30 
GeneralRe: Floating point conversion Pin
k50544-Dec-15 5:21
mvek50544-Dec-15 5:21 
QuestionIEEE 754-1985 Pin
enhzflep4-Dec-15 6:43
Memberenhzflep4-Dec-15 6:43 
AnswerRe: Floating point conversion Pin
S.T.K8-Dec-15 4:19
MemberS.T.K8-Dec-15 4:19 
QuestionComboboxx issue in MFC Pin
Amrit Agr3-Dec-15 3:48
MemberAmrit Agr3-Dec-15 3: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 4:50
mveRichard MacCutchan3-Dec-15 4:50 
QuestionVisual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
Javier Luis Lopez26-Nov-15 1:09
MemberJavier Luis Lopez26-Nov-15 1:09 
AnswerRe: Visual Studio errYou should declare it or LNK2005: variable XXX redefined in xxx.obj Pin
Richard MacCutchan26-Nov-15 1:24
mveRichard MacCutchan26-Nov-15 1:24 
GeneralRe: Visual Studio errYou should declare it or LNK2005: variable XXX redefined in xxx.obj Pin
Javier Luis Lopez26-Nov-15 1:53
MemberJavier Luis Lopez26-Nov-15 1:53 
GeneralRe: Visual Studio errYou should declare it or LNK2005: variable XXX redefined in xxx.obj Pin
Richard MacCutchan26-Nov-15 2:11
mveRichard MacCutchan26-Nov-15 2:11 
GeneralRe: Visual Studio errYou should declare it or LNK2005: variable XXX redefined in xxx.obj Pin
Javier Luis Lopez26-Nov-15 4:29
MemberJavier Luis Lopez26-Nov-15 4:29 
GeneralRe: Visual Studio errYou should declare it or LNK2005: variable XXX redefined in xxx.obj Pin
Richard MacCutchan26-Nov-15 5:26
mveRichard MacCutchan26-Nov-15 5:26 
AnswerRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
Daniel Pfeffer26-Nov-15 7:34
professionalDaniel Pfeffer26-Nov-15 7:34 
GeneralRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
CPallini26-Nov-15 22:09
mveCPallini26-Nov-15 22:09 
GeneralRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
Richard MacCutchan26-Nov-15 23:23
mveRichard MacCutchan26-Nov-15 23:23 
GeneralRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
Daniel Pfeffer28-Nov-15 7:51
professionalDaniel Pfeffer28-Nov-15 7:51 
AnswerRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
«_Superman_»29-Nov-15 19:46
professional«_Superman_»29-Nov-15 19:46 
GeneralRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
Richard MacCutchan29-Nov-15 23:22
mveRichard MacCutchan29-Nov-15 23:22 
GeneralRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
«_Superman_»30-Nov-15 0:07
professional«_Superman_»30-Nov-15 0:07 
GeneralRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
Richard MacCutchan30-Nov-15 0:38
mveRichard MacCutchan30-Nov-15 0:38 
GeneralRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
«_Superman_»30-Nov-15 0:40
professional«_Superman_»30-Nov-15 0:40 
GeneralRe: Visual Studio error LNK2005: variable XXX redefined in xxx.obj Pin
Richard MacCutchan30-Nov-15 1:01
mveRichard MacCutchan30-Nov-15 1:01 

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.