ScheduleHelper.SheduleRecording returns Nothing
I am working on a small app using the Reminders and Recordings in GB-PVR.
I am using the SheduleRecording function and it always return Nothing (or null). I get Recording failed when I try to do the same with EWA.
The ScheduleHelper.getInstance works because I can read the guide et set and remove reminder. Is there a way to get more info about what's happening? I get no exception et nothing in the logs folder.
Public Shared Function ScheduleRecording(ByVal program As Programme) As Boolean
Dim ScheduledRec As ScheduledRecording
ScheduledRec = Schedules.SheduleRecording(program.getChannelOID, _
Return Not ScheduledRec Is Nothing
Are you doing this as plugin inside PVRX2.exe or GBPVRRecordingService.exe? GB-PVR's Plugin APIs only work inside these processes.
It's a stand alone application that uses GBPVRBackendCommon.dll and GBPVRPublic.dll.
I first create a ScheduleHelper instance (ScheduleHelper.getInstance). I call GetListingsForTimePeriod loop through the listings, get the programme object that match certain criteria. I then call CreateReminder, RemoveReminder or SheduleRecording functions. The remindeer functions worked but not the recording. It doesn't work in EWA neither.
Sorry, but as I mentioned this in your other thread a few days ago, the API doesnt work outside of PVRX2.exe or GBPVRRecordingService.exe. You might of got lucky with some calls, but in general there is various environment stuff configured by those processes that will be missing when you try to do it in a standalone process. For example, the calls you mentioned above that work, are all ones that simply read/write the gbpvr.db3. When you try to schedule a recording, it needs to use the GB-PVR communication functions for talking to the Recording Service.
Ok, that makes sense. But I still don't get how EWA can make recording works (even though it doesn't work on my machine).
Does a GB-PVR log get automatically created for you process?
I never though about looking in my app folder...damn!
I found the problem, I just had to put the NativeUtilities.dll in my folder and it works fine now.
2008-09-10 19:50:03.027 VERBOSE  Looking for missing assembly in : NativeUtilities, Version=1.0.3071.28412, Culture=neutral, PublicKeyToken=null
2008-09-10 19:50:03.027 VERBOSE  Looking for missing assembly in plugin\common: NativeUtilities, Version=1.0.3071.28412, Culture=neutral, PublicKeyToken=null
2008-09-10 19:50:03.035 ERROR  Error creating: GBPVR.Backend.Common.AnalogHighDefRecordingSource
2008-09-10 19:50:03.035 ERROR  Exception has been thrown by the target of an invocation.
2008-09-10 19:50:03.036 ERROR  at System.RuntimeTypeHandle.CreateInstance(RuntimeTyp e type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at GBPVR.Backend.Common.xc4f12ec3a8a4c96b.xb18f2a6855 a29bd8(String xa17d71c8507c19de)
It works when it's executed in it's own AppDomain
Originally Posted by sub