Print Page | Close Window

More than one instance of calendar Ctrl?

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=2780
Printed Date: 19 April 2024 at 11:24am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: More than one instance of calendar Ctrl?
Posted By: RolandoE.
Subject: More than one instance of calendar Ctrl?
Date Posted: 24 August 2005 at 1:53pm

Hi,

I'm running into a small problem. I have one screen (Schedule Planner) which uses the Calendar control and I have no problems with it. Since I can get to appointments events via another screen I have the need to create and access the Calendar control.

The problem I am having is when I save the information. When I return the Schedule Planner screen the program crashes. I need to manually remove the modified event so the program can work once again.

I am creating and calling all of the calendar controls just like in the Schedule Planner screen except I am not calling the Populate method. Could this be the problem?

Thanks.



-------------
Rolando E. Cruz-Marshall



Replies:
Posted By: sserge
Date Posted: 24 August 2005 at 3:35pm
Rolando,

It's not absolutely clear what is your problem, I'd probably need to look at your sample.

But most likely, to work properly, your application would also need to increase objects reference count before working with them in different places.

--
WBR,
Serge


Posted By: RolandoE.
Date Posted: 24 August 2005 at 5:37pm

Hi,

What I am trying to explain is that I have two different sections of the program (Schedule Planner [Calendar Control is displayed here] and Contact Appointments [Hidden Calendar Control]) which can access the same dialog box I created to add or edit appointments.

If I call the Add Appointment dialog from the Schedule Planner screen I can add, edit or delete appointments just fine.

If I call the Add appointment dialog from the Contact Appointments screen I can also display information from the (hidden) Calendar and save the changes made to the appointment (Event record). When I return to the Schedule Planner screen the program will crash and continue to crash until I manually delete the offending event from the Event Table.

Hope this explanation helps.



-------------
Rolando E. Cruz-Marshall


Posted By: RolandoE.
Date Posted: 24 August 2005 at 8:51pm

Please disregard! I was able to figure out what to do.

Within the Add/Edit Appointment dialog box I create a new instance of the Calendar Control as a child of the window but I do not display it. I then set up a CXTPCalendarData, got the Data Provider (GetDataProvider) from m_wndCalendar and then an Open() method.

Now when the data is saved it is updating the calendar as well and the program is no longer crashing. It just seems to be a mix-up on my part trying to figure out how to use the Calendar control.

Thanks for the previous help.

 



-------------
Rolando E. Cruz-Marshall



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