Print Page | Close Window

Bug - CalendarDemo, custom tooltip

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=14456
Printed Date: 27 April 2024 at 12:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug - CalendarDemo, custom tooltip
Posted By: Algae
Subject: Bug - CalendarDemo, custom tooltip
Date 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.



Replies:
Posted By: mdoubson
Date 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



-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net