Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Crash on Calendar (Day Mode) Double Click
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Crash on Calendar (Day Mode) Double Click

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

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post Topic: Crash on Calendar (Day Mode) Double Click
    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.
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2008 at 5:28pm
Hi,

Have you initialized COM in the beginning?

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


--
WBR,
Serge
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2008 at 7:50am
Hello,
 
try to add
    m_Sink.UnadviseAll();
to your view destructor.
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post 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:-


Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post Posted: 23 September 2008 at 5:11am
Hello Codejock Team,

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



Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2008 at 2:06am
Hi,
try to minimize your application, reproduce it and attach it in support@codejock.com  or here.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.203 seconds.