Print Page | Close Window

Crash on Calendar (Day Mode) Double Click

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=10502
Printed Date: 23 November 2024 at 11:08am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Crash on Calendar (Day Mode) Double Click
Posted By: prashant
Subject: Crash on Calendar (Day Mode) Double Click
Date Posted: 05 May 2008 at 7:04am
Hi,

I trapped message for handling double click on Day Mode. My code is as follows:

In constructor of my Calendar View

CXTPNotifyConnection* ptrCalendarConn = GetCalendarCtrl().GetConnection();
    ASSERT(ptrCalendarConn);
   if(!ptrCalendarConn)
   {       
        return;
    }

//To Trapp the DBLCLK on Calendar
   m_Sink.Advise(ptrCalendarConn, XTP_NC_CALENDARLBUTTONDBLCLICK, &CCalViewNew::OnEvent_Calendar);

void CMyViewNew::OnEvent_Calendar(XTP_NOTIFY_CODE Event, WPARAM wParam, LPARAM lParam)
{
    I am displaying my own dialog here for taking input data
}

I am getting CRASH at following location
XTPNotifyConnection.cpp

BOOL CXTPNotifyConnection::SendEvent(XTP_NOTIFY_CODE Event,
                                WPARAM wParam , LPARAM lParam, DWORD dwFlags)
{
    /* CRASH HERE*/
        catch(...)
        {
            ASSERT(FALSE);
            TRACE(_T("EXCEPTION! CXTPNotifyConnection::SendEvent(Event                         = %d, wParam = %d, lParam = %d, dwFlags = %x)\n"),
                    Event, wParam, lParam, dwFlags);
        }

}

Last call from my code before crash is:

pMyTemplate->InitialUpdateFrame(pMyFrame, pMyDocument, bMakeVisible);

Can you please advise.



Replies:
Posted By: prashant
Date Posted: 08 May 2008 at 4:19am
Hello,

Can anybody please suggest the solution?

Here is the call stack where it crashes on double clicking on Day View

CXTPNotifyConnection::SendEvent(unsigned long 10634, unsigned int 13041917, long 0, unsigned long 0) line 195 + 34 bytes
CXTPCalendarControl::SendNotification(unsigned long 10634, unsigned int 13041917, long 0) line 2711
CXTPCalendarControl::OnLButtonDblClk(unsigned int 1, CPoint {x=253 y=199}) line 734 + 27 bytes



Posted By: sserge
Date Posted: 10 July 2008 at 5:28pm
Hi,

Have you initialized COM in the beginning?

BOOL CCalendarDemoApp::InitInstance()
{
    VERIFY( AfxOleInit() );


--
WBR,
Serge


Posted By: prashant
Date Posted: 08 September 2008 at 3:10am
Hi,

Yes, I initialized COM at the beginning of my application.

if (!AfxOleInit())
{
return FALSE;
}

Still I am getting same error. Any solution?


Posted By: AndreiM
Date Posted: 09 September 2008 at 7:50am
Hello,
 
try to add
    m_Sink.UnadviseAll();
to your view destructor.


-------------
Regards,
Andrei Melnik


Posted By: prashant
Date Posted: 09 September 2008 at 10:46am
Thanks for your reply. But getting same problem.

Let me explain scenario:

I am getting above mentioned Crash on double clicking particular Day Event.

Waiting for your valuable feedback.



Posted By: AndreiM
Date Posted: 09 September 2008 at 11:35am
Try to comment your code inside CMyViewNew::OnEvent_Calendar to determine where problem is.
If problem still occur - this means that we have bad ptrSink pointer. Try to look in the debugger what is the object pointed by ptrSink. It looks like some object call Advise but does not call Unadvise when destroyed.


-------------
Regards,
Andrei Melnik


Posted By: prashant
Date Posted: 10 September 2008 at 1:47am
Hi,

Here is the location of Crash:

XTPNotifyConnection.cpp

BOOL CXTPNotifyConnection::SendEvent(XTP_NOTIFY_CODE Event,                                        WPARAM wParam , LPARAM lParam, DWORD dwFlags)

Line:-
catch(...)
{
ASSERT(FALSE);
TRACE(_T("EXCEPTION! CXTPNotifyConnection::SendEvent(Event = %d, wParam = %d, lParam = %d, dwFlags = %x)\n"),
Event, wParam, lParam, dwFlags);
}

Event = 10634

Here is the call Stack:-




Posted By: prashant
Date Posted: 23 September 2008 at 5:11am
Hello Codejock Team,

I am waiting for your response for this and many more queries.





Posted By: Oleg
Date Posted: 24 September 2008 at 2:09am
Hi,
We need some sample to reproduce problem. Can you modify our Calendar sample or try reproduce sample problem with it ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: prashant
Date Posted: 25 September 2008 at 12:21am
Hi Oleg,

I am not able to reproduce the problem in CJ calendar sample.

Also please answer following queries:

1) https://forum.codejock.com/forum_posts.asp?TID=12230&KW=
2) https://forum.codejock.com/forum_posts.asp?TID=12183&KW=

Thanks in advance.


Posted By: Oleg
Date Posted: 25 September 2008 at 2:06am
Hi,
try to minimize your application, reproduce it and attach it in mailto:support@codejock.com - support@codejock.com  or here.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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