Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Cosmetic 'bug' in CXTPPropertyGridItemDate
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Cosmetic 'bug' in CXTPPropertyGridItemDate

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Cosmetic 'bug' in CXTPPropertyGridItemDate
    Posted: 13 February 2007 at 2:40pm
Hi,
After a few hours of debugging I found a 'cosmetic bug' in CXTPPropertyGridItemDate::SetValue(). When CXTPPropertyGridItemDate::ParseDateTime fails, SetValue() uses COleDateTime::ParseDateTime() to get a result. This function uses the locale ID provided as third parameter to determine the string format. The function only succeeds, when the string format is in Russian date format. I believe this should be changed to LANG_USER_DEFAULT.
I also suggest to NLS enable the date item by default to prevent from always calling SetDateFormat() and SetMask() to get locale dependant date entry.

void CXTPPropertyGridItemDate::SetValue(CString strValue)

{
    COleDateTime dt;
    TRY
    {
        if (ParseDateTime(dt, strValue))
        {
            SetDate(dt);
        }
        else if (dt.ParseDateTime(strValue, VAR_DATEVALUEONLY, LANG_RUSSIAN))
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.