|  | 
| CXTPCalendarCustomDataProvider | 
| Post Reply   | 
| Author | |
| sbinder   Groupie     Joined: 22 November 2004 Location: Austria Status: Offline Points: 76 |  Post Options  Thanks(0)  Quote  Reply  Topic: CXTPCalendarCustomDataProvider Posted: 17 November 2008 at 10:27am | 
| 
   I created my own Data Provider derived from CXTPCalendarCostumDataProvider. 
 (I use CXTPCalendarControl without CXTPCalendarControlView)  m_pData = new CDataProvider(); CXTPCalendarResources calRes; CXTPCalendarSchedules* pSchedules = m_pData-GetSchedules(); ASSERT(pSchedules); for(int i=0; i<2; ++i){  pSchedules->AddNewSchedule("NEU");  CXTPCalendarResource *pRes = new CXTPCalendarResource();  pRes->SetName("NEU");  pRes->GetSchedules()->Add(i+1);  pRes->SetDataProvider(m_pData, FALSE);  calRes.Add(pRes); } m_pCal->SetResources(&calRes); That works fine, but.... I am not able to delete my m_pData Object.  delete m_pData;  crashed in CCmdTarget::~CCmdTarget()  -> ASSERT(m_dwRef <= 1); I tried it also with  CMDTARGET_RELEASE(m_pData); no crash but memory leaks. Any help about this topic would make me very happy. | |
|  | |
| mdoubson   Senior Member     Joined: 17 November 2008 Status: Offline Points: 1705 |  Post Options  Thanks(0)  Quote  Reply  Posted: 18 November 2008 at 9:21am | 
| 
   Look into the sample SQLServerDataProvider and function SafeReleaseSQLDataProvider() in SQLServerDataProviderDoc file.
    | |
|  | |
| sbinder   Groupie     Joined: 22 November 2004 Location: Austria Status: Offline Points: 76 |  Post Options  Thanks(0)  Quote  Reply  Posted: 20 November 2008 at 4:51am | 
| 
   Thank you, but I solved my problem. I override the CXTPCalendarEvent class and that made problems.
    | |
|  | |
| 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 |