Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Bug with date format parsing in StripFormat()
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug with date format parsing in StripFormat()

 Post Reply Post Reply
Author
Message
ES View Drop Down
Newbie
Newbie


Joined: 02 October 2010
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote ES Quote  Post ReplyReply Direct Link To This Post Topic: Bug with date format parsing in StripFormat()
    Posted: 02 October 2010 at 6:45am
Hi,
I've discovered a bug in CXTPCalendarUtils::StripFormat() when running the sample Calendar demo and having a Windows date format containing a text string before the datum, i.e. 'today is 2/10-2010'. Maybe only a local issue as the default Windows date format varies, but nevertheless a bug...(as my localized version of Windows use this type of date format as default).

What happens is nIndex becomes -1 before checking IsFormatChar(strFormat[nIndex]), which causes an exception. A simple problem to correct, but I guess it should be done by Codejock in an upcoming release to propagate the fix to all users.
I've attached the code snippet below, the first while block finds a '-character in the first position (0) and then subtracts (with nIndex--) twice before ending the loop. Then nIndex++ adds one, but nIndex is still negative when entering the last while block;



/ES

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.094 seconds.