NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 64 65 66 67 68 … 93 Next »
Plugin not in Config list

 
  • 0 Vote(s) - 0 Average
Plugin not in Config list
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#1
2005-12-04, 10:20 PM
After adding an extra config setting my plugin now does not show in the config app. It builds fine but the config.exe log reports a good old null object ref at the plugin's constructor

Code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Xml;
using CommonGBPVRUtilities;
using GBPVR.Public;

namespace UKCinemaListingsPlugin
{
    /// <summary>
    /// Summary description for UKCinemaListingsPluginConfigForm.
    /// </summary>
    public class UKCinemaListingsPlugInConfigForm : System.Windows.Forms.Form
    {    
        // The settings we are passed from the config app
        private XmlDocument settings;
        
        private System.Windows.Forms.Label labelCinemaNumber;
        private System.Windows.Forms.Button buttonOK;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox textBoxCinemaNumber;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox textBoxDefaultCinemaNumber;
        private System.Windows.Forms.Label labelDefaultCinemaNumber;

        /// <summary>
        /// Required designer variable.
        /// </summary>
        
        private System.ComponentModel.Container components = null;

        public UKCinemaListingsPlugInConfigForm(XmlDocument document)
        {
            // hold a reference to the config.xml document for later
            settings = document;
            
            //
            // Required for Windows Form Designer support
            //
            //InitializeComponent();

            LoadInitialSettings();
        }

        private void LoadInitialSettings()
        {
            // Initialize any settings needed on the form
            // Modify this to match the properties you use
            textBoxCinemaNumber.Text = ConfigFileUtilities.GetStringConfigSetting(settings, UKCinemaListings.MyPlugInConfigSectionName, "CinemaNumbers", "1004181",false);
            textBoxDefaultCinemaNumber.Text = ConfigFileUtilities.GetStringConfigSetting(settings, UKCinemaListings.MyPlugInConfigSectionName, "DefaultCinema", "1004181",false);
        }

        private void buttonOK_Click(object sender, System.EventArgs e)
        {
            // Create the root node if needed
            ConfigFileUtilities.CreateRootNodeIfNeeded(settings, UKCinemaListings.MyPlugInConfigSectionName);

            // Create or update each property
            // Modify this to save your properties
            ConfigFileUtilities.CreateOrUpdateProperty(settings, UKCinemaListings.MyPlugInConfigSectionName, "CinemaNumbers", textBoxCinemaNumber.Text);
            ConfigFileUtilities.CreateOrUpdateProperty(settings, UKCinemaListings.MyPlugInConfigSectionName, "DefaultCinema", textBoxDefaultCinemaNumber.Text);

            // .... file will be saved later by the config app, if the user presses the OK button
            this.Close();
        }


        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if(components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.labelCinemaNumber = new System.Windows.Forms.Label();
            this.buttonOK = new System.Windows.Forms.Button();
            this.label4 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.textBoxCinemaNumber = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.textBoxDefaultCinemaNumber = new System.Windows.Forms.TextBox();
            this.labelDefaultCinemaNumber = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // labelCinemaNumber
            //
            this.labelCinemaNumber.AutoSize = true;
            this.labelCinemaNumber.Location = new System.Drawing.Point(16, 24);
            this.labelCinemaNumber.Name = "labelCinemaNumber";
            this.labelCinemaNumber.TabIndex = 4;
            this.labelCinemaNumber.Text = "Cinema Number(s)";
            //
            // buttonOK
            //
            this.buttonOK.Location = new System.Drawing.Point(352, 200);
            this.buttonOK.Name = "buttonOK";
            this.buttonOK.Size = new System.Drawing.Size(96, 32);
            this.buttonOK.TabIndex = 9;
            this.buttonOK.Text = "OK";
            this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
            //
            // label4
            //
            this.label4.Location = new System.Drawing.Point(16, 104);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(360, 16);
            this.label4.TabIndex = 10;
            this.label4.Text = "1) Go to http://www.britinfo.net/cinema/index.htm and find your cinema.";
            //
            // label2
            //
            this.label2.Location = new System.Drawing.Point(16, 128);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(448, 16);
            this.label2.TabIndex = 11;
            this.label2.Text = "2) Look in the address bar and you will see a 7 digit number, this is the cinema " +
                "number.";
            //
            // textBoxCinemaNumber
            //
            this.textBoxCinemaNumber.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.textBoxCinemaNumber.Location = new System.Drawing.Point(120, 24);
            this.textBoxCinemaNumber.Name = "textBoxCinemaNumber";
            this.textBoxCinemaNumber.Size = new System.Drawing.Size(336, 22);
            this.textBoxCinemaNumber.TabIndex = 12;
            this.textBoxCinemaNumber.Text = "";
            //
            // label3
            //
            this.label3.Location = new System.Drawing.Point(28, 144);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(360, 16);
            this.label3.TabIndex = 14;
            this.label3.Text = "To enter multiple cinemas simply add a comma between each number.";
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(16, 168);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(440, 16);
            this.label1.TabIndex = 17;
            this.label1.Text = "3) Choose your favourite cinema and enter its number in \'Default Cinema\'. ";
            //
            // textBoxDefaultCinemaNumber
            //
            this.textBoxDefaultCinemaNumber.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.textBoxDefaultCinemaNumber.Location = new System.Drawing.Point(120, 56);
            this.textBoxDefaultCinemaNumber.Name = "textBoxDefaultCinemaNumber";
            this.textBoxDefaultCinemaNumber.Size = new System.Drawing.Size(112, 22);
            this.textBoxDefaultCinemaNumber.TabIndex = 16;
            this.textBoxDefaultCinemaNumber.Text = "";
            //
            // labelDefaultCinemaNumber
            //
            this.labelDefaultCinemaNumber.Location = new System.Drawing.Point(16, 56);
            this.labelDefaultCinemaNumber.Name = "labelDefaultCinemaNumber";
            this.labelDefaultCinemaNumber.Size = new System.Drawing.Size(82, 16);
            this.labelDefaultCinemaNumber.TabIndex = 15;
            this.labelDefaultCinemaNumber.Text = "Default Cinema";
            //
            // UKCinemaListingsPlugInConfigForm
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(472, 246);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.textBoxDefaultCinemaNumber);
            this.Controls.Add(this.textBoxCinemaNumber);
            this.Controls.Add(this.labelCinemaNumber);
            this.Controls.Add(this.labelDefaultCinemaNumber);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.buttonOK);
            this.Name = "UKCinemaListingsPlugInConfigForm";
            this.Text = "UK Cinema Listings Config";
            this.ResumeLayout(false);

        }
        #endregion
    }
}

Please Help :confused:
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,946
Threads: 770
Joined: Nov 2003
#2
2005-12-04, 10:25 PM
Run it up in the debugger and see where it stops.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,946
Threads: 770
Joined: Nov 2003
#3
2005-12-04, 10:26 PM
Did you mean to comment out InitializeComponent();?
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#4
2005-12-04, 10:35 PM
No I didnt lol. Uncommented but still the same error.

How do I setup debuging with an external .exe?

Ive set the 'Start program' in Visual Studio.net project properties to config.exe and setup a breakpoint on settings = document; but it just goes straight through and starts the config app. Am I missing something silly?

Thanks for your quick replies sub Smile
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,946
Threads: 770
Joined: Nov 2003
#5
2005-12-04, 10:39 PM
You might need to explicitly set the debug type to 'mixed' as some times it gets confused.

You could also try selecting Debug -> Exceptions from the menu, and from there set 'common language runtime exceptions' to 'break into debugger'
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#6
2005-12-04, 10:53 PM (This post was last modified: 2012-03-01, 05:52 AM by McBainUK.)
sub Wrote:You might need to explicitly set the debug type to 'mixed' as some times it gets confused.

You could also try selecting Debug -> Exceptions from the menu, and from there set 'common language runtime exceptions' to 'break into debugger'

Done the 2nd one, couldnt find an option for the 1st one.
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#7
2005-12-05, 07:02 PM
Ok I've tried lots of things. Reverted to a known, working config form and still does not appear in the the plugin list.

Code:
05/12/2005 19:00:30.984    ERROR    [7]    Error initializing menu plugin: C:\Program Files\devnz\gbpvr\\plugins\UKCinemaListings.dll
05/12/2005 19:00:30.984    ERROR    [7]    Exception has been thrown by the target of an invocation.
05/12/2005 19:00:31.000    ERROR    [7]       at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at a6.e()
05/12/2005 19:00:31.000    ERROR    [7]    Inner exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at UKCinemaListingsPlugin.UKCinemaListings..ctor()
05/12/2005 19:00:31.000    ERROR    [7]       at UKCinemaListingsPlugin.UKCinemaListings..ctor()

I've tried sub's suggestions but still can't get the debugger to work, it says that I can't see the source code at the breakpoint. :mad:

Funny thing is, if I put this in Activate() the config form appears fine (even with correctly loaded config variables!)
Code:
            System.Xml.XmlDocument document2 = new System.Xml.XmlDocument();
            Logger.Verbose("TESTING : " + document2.ToString()); // Write to debug file
            System.Windows.Forms.Form test = GetConfigFormInstance(document2);
            test.Show();

If it can init and show the form, why can't it do it when called by the config app? Please help. Almost finished this release but I'm going crazy with this config form problem.
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,946
Threads: 770
Joined: Nov 2003
#8
2005-12-05, 07:08 PM
If you want to email it over I'll take look. I can see your problem looking at these snippets of code.
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#9
2005-12-05, 07:20 PM
Sent.
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,946
Threads: 770
Joined: Nov 2003
#10
2005-12-05, 07:35 PM
The PluginHelperFactory.getPluginHelper() call returns null when in config mode. The error occur on line 101 of UKCinemaListings.cs when you run the config app.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 3,338 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,910 2020-11-14, 08:01 PM
Last Post: sub
  Channels List by Channel Group Name scJohn 1 2,976 2018-01-05, 10:45 PM
Last Post: mvallevand
  Channel List (native controller) psycik 2 3,295 2017-06-19, 09:14 AM
Last Post: psycik
  VIdeo playback from plugin mvallevand 5 3,861 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 3,162 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 3,019 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,690 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 2,172 2013-03-12, 06:48 AM
Last Post: psycik
  List of "IEventNotification" events? reven 8 3,834 2012-11-01, 10:56 PM
Last Post: reven

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

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

Linear Mode
Threaded Mode