Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Bug - CalendarDemo, custom tooltip
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug - CalendarDemo, custom tooltip

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

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Topic: Bug - CalendarDemo, custom tooltip
    Posted: 04 June 2009 at 10:18pm
I think this has been around for some time, but thought I'd point it out.
          
Find in CalendarDemoView.

                INT_PTR CXTPCalendarControl_Custom::OnToolHitTest(CPoint point, TOOLINFO* pTI) const

This will cause a crash in unicode:

                int nBuffSize = strToolText.GetLength()*2 +10;
                TCHAR* pBuffer = (TCHAR*)malloc(nBuffSize);
                STRCPY_S(pBuffer, nBuffSize, (LPCTSTR)strToolText);
                pTI->lpszText = pBuffer;

I did a quick fix as follows:

                int nBuffSize = strToolText.GetLength() +10;
                TCHAR* pBuffer = (TCHAR*)calloc(nBuffSize,sizeof (TCHAR));
                STRCPY_S(pBuffer, nBuffSize, (LPCTSTR)strToolText);
                pTI->lpszText = pBuffer;

I found custom tooltips much easier to implement by editing the source rather than using a custom control anyhow.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2009 at 8:42am

Sure - this is very juniour task. But in 13.1 this is public member of CXTPCalendarControl

CString m_sCustomFormat4Tooltip;

//Free-styled tooltip tag-based way to fill tooltip string

//used tags <BODY>,<LOC>,<SUBJ>,<TIME> in any combination and  order and with any fillers

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.141 seconds.