Loading calendar data |
Post Reply |
Author | |
EricFowler
Groupie Joined: 01 December 2009 Status: Offline Points: 14 |
Post Options
Thanks(0)
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 |
|
EricFowler
Groupie Joined: 01 December 2009 Status: Offline Points: 14 |
Post Options
Thanks(0)
|
*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 |
|
EricFowler
Groupie Joined: 01 December 2009 Status: Offline Points: 14 |
Post Options
Thanks(0)
|
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(); |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |