Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello!
That's not a big question.
I'm working with CEdit. Everything included, I put DDV, also created my handlers for changing edit and set some properties like (only numbers etc.) but...

Sometimes I get value with a comma. I get 14,999 instead 14999. Does somebody know what is it?
I couldn't find nothing in internet.

Thanks a lot)

My data exchange:
C++
DDX_Text(pDX, IDC_EDIT_X, m_pLayout->m_nX);
DDX_Text(pDX, IDC_EDIT_Y, m_pLayout->m_nY);

DDV_MinMaxInt(pDX, m_pLayout->m_nHeight, 0, RANGE);
DDV_MinMaxInt(pDX, m_pLayout->m_nWidth, 0, RANGE);



Handler for spin:
C++
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;

UpdateData(TRUE);
UpdateSpinVal(m_pLayout->m_nWidth, pNMUpDown->iDelta);


Update spin:
C++
void UpdateSpinVal(int & val, int & delta)
{
    int iTemp = val += delta;

    if(val > RANGE)
        val = RANGE;

    if(val < 0)
        val = 0;

    UpdateData(FALSE);

    if(iTemp != val)
        return;

    m_bWasSpin = TRUE;
    UpdateData(FALSE);
}


That's my code
Everything is OK. I'm quitly surprised!
Posted
Updated 4-Jun-13 23:18pm
v2
Comments
nv3 4-Jun-13 7:32am    
Looks to me like you are adding a thousands-separator in your custom DDX functions.
Richard MacCutchan 4-Jun-13 7:35am    
You need to show your code; no one can guess what you are doing.
YvesDaoust 4-Jun-13 11:27am    
Have a look at the Regional Settings on your machine (Control Panel). It can be that the thousands separator is set to be the comma. Defining it as empty could help.
thomas_wingfield 5-Jun-13 5:43am    
it helps. thanks
YvesDaoust 5-Jun-13 6:03am    
thanks for the feedback :)

1 solution

It looks like a formating problem. Check that you use the right Version of the DDV functions for your used data type.

And check that the CEdit has the right data type in the resource file.

PS: it looks like a number issue, in which you have configured "," as 1000-separator and reading a string. Use the DDV function for an integer.
 
Share this answer
 
Comments
thomas_wingfield 5-Jun-13 5:10am    
Hello!
everything's ok! but problem exists
KarstenK 5-Jun-13 5:24am    
show some code!!!

1. the DDV of the control
2. type of member
3. the resource code of the edit
thomas_wingfield 5-Jun-13 5:42am    
Look! In resources I checked Only numbers.
When I'm putting a huge number(out of range) and click spin down(without enter).It becomes number with comma.
Only if I change Customize format -> Digit grouping it helps
thomas_wingfield 5-Jun-13 5:42am    
Thank you Karstenek

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900