Print Page | Close Window

problems with multiple resources

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=5559
Printed Date: 05 July 2024 at 1:25pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: problems with multiple resources
Posted By: mario.painsi
Subject: problems with multiple resources
Date Posted: 20 November 2006 at 4:48am
hello, we have a problem.
 
we are working with gupta.
we want to make a calender but we have problems with the multiple resources.
 
the code for one resource is working:
 
Call CalendarControl.PropGetDataProvider( CalenderDataProvider )
Call CalendarControl.PropGetMultipleResources( ICalendarResources )
Call ICalendarResources.PropGetItem( 0, ICalendarResource )
Call ICalendarResource.PropGetScheduleIDs( CalendarScheduleIDs )
Call CalendarScheduleIDs.Add( 1 )
Call ICalendarResource.PropSetName( 'A')
Call ICalendarResources.Add( ICalendarResource )
Call CalendarControl.SetMultipleResources( ICalendarResources )
Call CalendarControl.RedrawControl(  )
Call CalendarControl.Populate(  )
 
 
but, when we want to add a second or more, we only see the last resource, for example:
 
Call CalendarControl.PropGetDataProvider( CalenderDataProvider )
Call CalendarControl.PropGetMultipleResources( ICalendarResources )
 
Call ICalendarResources.PropGetItem( 0, ICalendarResource )
Call ICalendarResource.PropGetScheduleIDs( CalendarScheduleIDs )
Call CalendarScheduleIDs.Add( 1 )
Call ICalendarResource.PropSetName( 'A')
Call ICalendarResources.Add( ICalendarResource )
Call ICalendarResources.PropGetItem( 1, ICalendarResource )
Call ICalendarResource.PropGetScheduleIDs( CalendarScheduleIDs )
Call CalendarScheduleIDs.Add( 2)
Call ICalendarResource.PropSetName( 'B')
Call ICalendarResources.Add( ICalendarResource )
Call CalendarControl.SetMultipleResources( ICalendarResources )
Call CalendarControl.RedrawControl(  )
Call CalendarControl.Populate(  )
 
we only see 'B'.
 
can you help us.
thanks




Replies:
Posted By: sserge
Date Posted: 21 November 2006 at 1:37pm
Hi,

Those objects are passed by reference.
You have to create a separate object for each resource...



Call CalendarControl.PropGetDataProvider( CalenderDataProvider )
Call CalendarControl.PropGetMultipleResources( ICalendarResources )
Call ICalendarResources.PropGetItem( 0, ICalendarResource )
Call ICalendarResource.PropGetScheduleIDs( CalendarScheduleIDs )
Call CalendarScheduleIDs.Add( 1 )
Call ICalendarResource.PropSetName( 'A')
Call ICalendarResources.Add( ICalendarResource )
' creaate new resource object here
' also you can yse CreateObject like:
' set ICalendarResource = CreateObject("Codejock.CalendarResource.10.3.1")
set ICalendarResource = new CalendarResource
Call ICalendarResources.PropGetItem( 1, ICalendarResource )
Call ICalendarResource.PropGetScheduleIDs( CalendarScheduleIDs )
Call CalendarScheduleIDs.Add( 2)
Call ICalendarResource.PropSetName( 'B')
Call ICalendarResources.Add( ICalendarResource )
Call CalendarControl.SetMultipleResources( ICalendarResources )
Call CalendarControl.RedrawControl( )
Call CalendarControl.Populate( )


--
WBR,
Serge



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