NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 5 6 7 8 9 … 93 Next »
Noobie Here!

 
  • 0 Vote(s) - 0 Average
Noobie Here!
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#71
2014-03-22, 02:34 AM
Having a problem getting my files to play when using the Popup screen.

Get the following error;
"Object reference not set to an instance of an object"

I think it's stopping on the first DIM statement.


Public Sub HandleButtonCommand1(buttonName As String) Implements NUtility.Controls.UiButtonList.IUiButtonListCallback.HandleButtonCommand
If buttonName = "Play" Then
Dim ONumber = listShowTimes.GetSelectedObject("@oid")
Dim recording As ScheduledRecording = ScheduledRecording.LoadByOID(ONumber)
PluginHelperFactory.GetPluginHelper().PlayVideoFile((recording.Filename))
End If
End Sub



If I use the same 3 lines of code in my main module, under the Activate sub it works fine.

Public Overrides Sub ActivateItem(selectedObject As UiList.ListObject)
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#72
2014-03-22, 02:58 AM
Run it in the debugger and see exactly what line is giving you the "object reference not set..." error.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#73
2014-03-22, 03:00 AM
In C#, that Dim line would be something like this:

int oid = (int)listShowTimes.GetSelectedObject().properties["@oid"];

That doesn't look like the same thing as you're doing.
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#74
2014-03-22, 11:04 AM
I don't know how to run the plugin in debugger mode.
It tells me I need to add the executable project that the dll runs in, but I don't have that.
Anyhow, I'm fairly certain it's the DIM statement that it hangs on.

I ran your line of C# thru the converter....
"Dim onumber As Integer = CInt(listShowTimes.GetSelectedObject().properties("@oid"))"
and got the same error.

As I said, my original code works fine when used in the main module.
This is the first time I'm trying it in the POPUP module.

I assume I'm missing some sort of declaration or something, but I don't have enough experience to know what.
I've thrown every statement I thought might be missing in front of the code but still no go.

Once again I would ask if you could add the necessary code to the popup in your Test4 and hopefully that will enlighten me.

I'm trying to configure one of the popup buttons to PLAY the selected file.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#75
2014-03-22, 04:05 PM
jrockow Wrote:I don't know how to run the plugin in debugger mode.
It tells me I need to add the executable project that the dll runs in, but I don't have that.
Just tell it to run nextpvr.exe. It'll say it doesn't have the debug info for that executable, but that's fine - it'll still stop at any breakpoints or exceptions in your plugin's code. (assuming you've put the pdb in the same directory as the plugin dll)

Quote:Anyhow, I'm fairly certain it's the DIM statement that it hangs on.

I ran your line of C# thru the converter....
"Dim onumber As Integer = CInt(listShowTimes.GetSelectedObject().properties("@oid"))"
and got the same error.
Run it in the debugger, and check what listShowTimes.GetSelectedObject() is returning. It's probably returning null to say that nothing is selected.
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#76
2014-03-22, 05:02 PM
I am using Visual Studio 2010 Express Edition.
When I try to run debug I get this error:


A project with an Outout Type of Class Library cannot be started directly.
In order to debug this project, add an executable project to this solution
which references the library project. Set the executable project as the
startup project.


The ADD command allows for a NEW project, or an EXISTING project.
When I try to add an existing project (NEXTPVR.EXE) I get this error:

The selected file cannot be opened as a solution or project. Please
select a solution file or a project file.

Sorry for my ignorance, but I can't see a way around this.


In any event, I thought we already knew "It's probably returning null to say that nothing is selected." ?
Isn't that more or less the same as "Object reference not set to an instance of an object"?

Again, sorry I don't have more experience.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#77
2014-03-22, 05:25 PM
Quote:I am using Visual Studio 2010 Express Edition.
When I try to run debug I get this error:


A project with an Outout Type of Class Library cannot be started directly.
In order to debug this project, add an executable project to this solution
which references the library project. Set the executable project as the
startup project.
Just go into the project settings, goto the debug tab, and tell it to start an external program. See screenshot.

Quote:In any event, I thought we already knew "It's probably returning null to say that nothing is selected." ?
Yes, that's probably what's happening, so you just need to cope with it in an appropriate manner for however you want your plugin to behave. ie, check if GetSelectedObject() returns null before trying to use it. You can't get the oid of the currently selected recording if no recording is selected.
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#78
2014-03-22, 05:49 PM
This doesn't look the same as yours?
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#79
2014-03-22, 05:55 PM
My problem is I don't know how to code the popup window to select the recording.
As I said, the same code works fine in the main module.
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#80
2014-03-22, 06:32 PM
I had an idea to put the select object call in my main module before calling the popup, and then just pass the filename value over to the popup skin, but I'm not having much luck declaring the item as public.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (17): « Previous 1 … 6 7 8 9 10 … 17 Next »
Jump to page 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode