Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - [solved] Calendar crashes using the tab button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] Calendar crashes using the tab button

 Post Reply Post Reply
Author
Message
Lifthrasil View Drop Down
Groupie
Groupie


Joined: 28 February 2017
Status: Offline
Points: 10
Post Options Post Options   Thanks (1) Thanks(1)   Quote Lifthrasil Quote  Post ReplyReply Direct Link To This Post Topic: [solved] Calendar crashes using the tab button
    Posted: 28 February 2017 at 4:47am
I start your sample version 17.3.0.0.
In this version I've the theme (important) Office 2013 -> Outlook activated and I do not fill the calendar with sample data. So it's empty.
If I go to monday and create a new event, give it a name, check the "all day event" checkbox and press ok, this event is created. If I now press the "tab" key on my keyboard it's crashing.

I'v not found your bug report interface , that's why I'm posting it here.
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2017 at 6:45am
Hello Lifthrasil,

Thank you for bringing this to our attention. There is exception "integer division by zero" in Source\Calendar\XTPCalendarDayView.cpp   CXTPCalendarDayView::_EnsureVisibleV()
int nEventIndex = (pViewEvent->m_rcEvent.top - m_LayoutX.m_rcAllDayEvents.top) /m_LayoutX.m_nAllDayEventHeight + m_LayoutX.m_nTopAllDayRow;


I have added this to our bug base. The problem will be addressed according to its priority. You will be notified through this forum topic about any progress on this task.

For reports about bugs you can use form on our site   https://www.codejock.com/support
in menu Support > Request Support.

Regards,
 Oleksandr Lebed
Back to Top
Lifthrasil View Drop Down
Groupie
Groupie


Joined: 28 February 2017
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lifthrasil Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2017 at 7:24am
Hi!

The thing is, that we (Copa Data) have bought the calendar (source code) and actually we have this problem also in our program. So if I would know, that this issue is fixed in a certain amount of time, I would not have to invest time to find a temporary fix. Would this be possible? Would it then be possible to send us the code with the fix or a description what to fix, how and where? This would be really nice :D
Thanks in advance for your support!
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2017 at 7:33am
in file Source\Calendar\XTPCalendarDayView.cpp method   CXTPCalendarDayView::_EnsureVisibleV()
I think you can use "max" to prevent division by zero, but I don't have enough time to check whole algorithm now.
int nEventIndex = (pViewEvent->m_rcEvent.top - m_LayoutX.m_rcAllDayEvents.top) /max(1, m_LayoutX.m_nAllDayEventHeight + m_LayoutX.m_nTopAllDayRow);
Back to Top
Lifthrasil View Drop Down
Groupie
Groupie


Joined: 28 February 2017
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lifthrasil Quote  Post ReplyReply Direct Link To This Post Posted: 28 February 2017 at 7:46am
Hi!

No sorry, that's not working because there's an ASSERT popping up and the event is not visible anymore afterwards.
It's not that urgent but if I would know that in the next 3 weeks it would be possible to get a bug fix for our version (we use an older one, 16.4.0.0) it would be very cool because then we would not invest time in it any more ;)
Because until now I am a little bit confused. It seems that these variables are not initialized because when using Office 2013 Outlook the AdjustLayout function of the views isn't called, which would set them. But I am not sure if this is ok or not ;)
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 06 March 2017 at 5:20pm
Hello Lifthrasil,

We have solved this bug with fix below
BOOL CXTPCalendarDayView::_EnsureVisibleV(CXTPCalendarViewEvent* pViewEvent)
{
    if (!pViewEvent || !pViewEvent->GetEvent() || !GetCalendarControl() ||
        !XTP_SAFE_GET2(pViewEvent, GetViewGroup_(), GetViewDay_(), NULL) )
    {
        ASSERT(FALSE);
        return FALSE;
    }

    //---------------------------------------------------------------------------
    if (pViewEvent->IsMultidayEvent())
    {
        if (0 != m_LayoutX.m_nAllDayEventHeight)
        {
            int nEventIndex = (pViewEvent->m_rcEvent.top - m_LayoutX.m_rcAllDayEvents.top) / m_LayoutX.m_nAllDayEventHeight + m_LayoutX.m_nTopAllDayRow;

            if (nEventIndex >= m_LayoutX.m_nTopAllDayRow + m_LayoutX.m_nVisibleAllDayCount)
            {
                m_LayoutX.m_nTopAllDayRow = nEventIndex - m_LayoutX.m_nVisibleAllDayCount + 1;
                return TRUE;
            }
            else if (nEventIndex < m_LayoutX.m_nTopAllDayRow)
            {
                m_LayoutX.m_nTopAllDayRow = nEventIndex;
                return TRUE;
            }
        }

        return FALSE;

    }
....


Regards,
 Oleksandr Lebed
Back to Top
Lifthrasil View Drop Down
Groupie
Groupie


Joined: 28 February 2017
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lifthrasil Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2017 at 7:14am
Hi!

Thank you very much for that fix! This works for us and I'm very happy about that!
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.171 seconds.