Print Page | Close Window

Custom Data provider question

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=7524
Printed Date: 01 October 2024 at 9:18am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom Data provider question
Posted By: nemanjas
Subject: Custom Data provider question
Date Posted: 04 July 2007 at 8:25am
Hi,

I'm using MSSQL data provider example as a staring point to make my own provider.

I've modified open/close/DoRetrieveDayEvents methods, and others are just returning NULLs. Helper method are also modified, and they seem to return valid data.

Problem is that Calendar control crashes upon executing Populate method. Since i'm just evaluating toolkit, i have no idea what happens inside Populate method and why it crashes?

Any ideas?





Replies:
Posted By: sserge
Date Posted: 04 July 2007 at 3:58pm
Hi,

Take a look at the following article: -
It describes ActiveX version, but concepts are same.

The thing you should note is:
Quote With the custom data provider the main thing you should implement is the body of RetrieveDayEvents handler. If it returns empty events collection, the control will always show nothing.


--
WBR,
Serge


Posted By: nemanjas
Date Posted: 05 July 2007 at 7:44am
Thank, but as you can see, i've implemented DoRetrieveDayEvents handler.

Problem is that Calendar control crashes, its not empty as that article is saying.

My implementation DoRetrieveDays returns valid CXTPCalendarEventsPtr, with, hopefully, valid data.

And again, on Populate, control crashes. To be precise it asserts. On line 1543 (check screenshot).

Thanks, Nemanja.


Posted By: nemanjas
Date Posted: 05 July 2007 at 7:54am
Forum ate my screenshot link :)
http://img381.imageshack.us/img381/5083/codejockeylq7.jpg


Posted By: sserge
Date Posted: 06 July 2007 at 3:23pm
Well...
Which version do you use? Is it an eval version or registered?

If you have toolkit sources - try to debug it to see where the problem is (press Retry in ASSERT dialog).
 
In any case try to localize a problem using following tricks:
-- do not return (add to collection) events in DoRetrieveDayEvents.  Is it working OK?
-- create one or 2 events manually and return them from DoRetrieveDayEvents. Is it working OK?
-- check your code which create events. Trace created events (at least start/end date-times)
-- check whether you work carefully with InternalAddRef / InternalRelease
 
If you will have no success - send us your project to analize a code into support area.

--
WBR,
Serge


Posted By: nemanjas
Date Posted: 09 July 2007 at 7:50am
It's a evaluation, so i cant see whats asserting...

Anyways, if i return empty items array on DoRetrieveDayEvents, control is working ok, so there must be something wrong in the way i'm creating events?

If I manually create event and event list, control asserts.

This is what i have in current event handler:

CLProvider::DoRetrieveDayEvents(COleDateTime dtDay)
{
    InternalAddRef();

    CXTPCalendarEventPtr pItem = CreateNewEvent(12345);

    pItem->SetSubject("Subject");
    pItem->SetStartTime(COleDateTime::GetCurrentTime());
    pItem->SetEndTime(COleDateTime::GetCurrentTime());

    CXTPCalendarEventsPtr pItems = new CXTPCalendarEvents;
    pItems->Add(pItem);

    InternalRelease();
    return pItems;
}

Can you see anything wrong with it?

Another thing, could you post what line 1543 from xtpcalendarviewday.h looks like?

Thanks, Nemanja



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