Loading calendar data
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=15919
Printed Date: 29 June 2025 at 7:20pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Loading calendar data
Posted By: EricFowler
Subject: Loading calendar data
Date Posted: 24 December 2009 at 12:39am
I am able to save calendar data to a file using the default, RAM provider. I do this by getting the data source, and setting it's connection string to a file name.
I then execute this code:
void CCalendar::OnDestroy()
{
CXTPCalendarData * pData = this->GetDataProvider();
if(pData)
{
if(pData->IsOpen())
{
pData->Save();
pData->Close();
}
}
__super::OnDestroy();
Revoke();
}
It creates a binary file, and I can see my data in it. All is good.
Now I need to load the data from the file into the app. I looked for a CXTPCalendarData::Load() or -Read() function to no avail.
I tried using Populate(), to no avail. Nothing loads.
What do I need to do? It should be simple.
Eric
|
Replies:
Posted By: EricFowler
Date Posted: 25 December 2009 at 11:06pm
*bump*
I know it's Christmas (for a little longer anyway) but I am stuck on this, so if any of Santa's elves know how to fix it, I have a candy cane for you.
Eric
|
Posted By: EricFowler
Date Posted: 26 December 2009 at 3:51pm
Looking at this further, I am calling Populate() but it is returning no data ... calendar remains empty.
Here is the code:
m_ctrlCalendar.SetDataProvider(xtpCalendarDataProviderMemory);
CXTPCalendarData * pData = m_ctrlCalendar.GetDataProvider();
CString strConnect = _T("Provider=XML;Data Source='.\\mystuff.caldata.xml'");
pData->SetConnectionString(strConnect);
VERIFY(m_ctrlCalendar.Create(WS_CHILD | WS_VISIBLE , rcCalendar, this, IDC_CALENDAR_CTRL_ID));
m_ctrlCalendar.ModifyStyleEx(0, WS_EX_STATICEDGE, 0);
CXTPCalendarControl::CUpdateContext updateCNT(&m_ctrlCalendar);
m_ctrlCalendar.Populate();
m_ctrlCalendar.RedrawControl();
|
|