Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Custom Data provider question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Custom Data provider question

 Post Reply Post Reply
Author
Message
nemanjas View Drop Down
Newbie
Newbie


Joined: 04 August 2006
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote nemanjas Quote  Post ReplyReply Direct Link To This Post Topic: Custom Data provider question
    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?


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: 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
Back to Top
nemanjas View Drop Down
Newbie
Newbie


Joined: 04 August 2006
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote nemanjas Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
nemanjas View Drop Down
Newbie
Newbie


Joined: 04 August 2006
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote nemanjas Quote  Post ReplyReply Direct Link To This Post Posted: 05 July 2007 at 7:54am
Forum ate my screenshot link :)
http://img381.imageshack.us/img381/5083/codejockeylq7.jpg
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: 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
Back to Top
nemanjas View Drop Down
Newbie
Newbie


Joined: 04 August 2006
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote nemanjas Quote  Post ReplyReply Direct Link To This Post 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
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.186 seconds.