Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - More than one instance of calendar Ctrl?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

More than one instance of calendar Ctrl?

 Post Reply Post Reply
Author
Message
RolandoE. View Drop Down
Groupie
Groupie
Avatar

Joined: 19 May 2003
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote RolandoE. Quote  Post ReplyReply Direct Link To This Post Topic: More than one instance of calendar Ctrl?
    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
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: 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
Back to Top
RolandoE. View Drop Down
Groupie
Groupie
Avatar

Joined: 19 May 2003
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote RolandoE. Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
RolandoE. View Drop Down
Groupie
Groupie
Avatar

Joined: 19 May 2003
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote RolandoE. Quote  Post ReplyReply Direct Link To This Post 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
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.160 seconds.