CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Location
    Gods own country, India
    Posts
    248

    Exclamation API for getting year range

    Hi All,


    Please see the attachement.
    What is the API for getting the range of year value.
    It seems GetLocaleInfo doesn not return that.



    Thanks in advance
    Attached Images Attached Images  

  2. #2
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: API for getting year range

    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  3. #3
    Join Date
    Oct 2009
    Posts
    1

    Lightbulb Re: API for getting year range

    Please find the code snippet for finding MaxYear using GetCalendarInfo

    void CSampleDlg::GetMaximumYear()
    {
    CString csMaxYear;
    TCHAR tcBuffer[256];
    int nSize = GetCalendarInfo( LOCALE_SYSTEM_DEFAULT,
    CAL_GREGORIAN_US,
    CAL_ITWODIGITYEARMAX,
    tcBuffer,
    0,
    0 );

    LPTSTR lpDateFmt = csMaxYear.GetBuffer( nSize );
    nSize = GetCalendarInfo( LOCALE_SYSTEM_DEFAULT,
    CAL_GREGORIAN_US,
    CAL_ITWODIGITYEARMAX,
    lpDateFmt,
    nSize,
    0 );
    csMaxYear = lpDateFmt;

    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured