MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
Thread Tools Display Modes
Old 2005-08-11, 23:57   #1 (permalink)
Anonymous
Guest
 
Posts: n/a


Default Plugin example doesnt show in list

Hi,

Ive been programming for some time now in C# and wanted to try and build a plugin for mediaportal (which ive been using for a bit longer).

I found the tutorial at http://mediaportal.sourceforge.net/P...inTutorial.htm which compiled fine, but it doesnt show up at the plugin list :\
Edit: The log says: Exception in plugin loading :The format of the file 'SomePlugin.dll' is invalid.

Ive searched the forum for a solution, but havent been lucky yet. Can anyone help me out?

Ive attached the code Ive compiled using Visual C# 2005 Express.

Code:
using System;
using System.Windows.Forms;
using MediaPortal.GUI.Library;

namespace SomePlugin
{
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    public class PluginClass : GUIWindow, ISetupForm
    {
        public PluginClass()
        {
           //
           // TODO: Add constructor logic here
           //
        }
        #region ISetupForm Members
 
        // Returns the name of the plugin which is shown in the plugin menu
        public string PluginName()
        {
           return "PluginClass";
        }
 
         // Returns the description of the plugin is shown in the plugin menu
        public string Description()
        {
           return "Does stuff.";
        }
 
        // Returns the author of the plugin which is shown in the plugin menu
        public string Author()     
        {
           return "me";
        }  
       
        // show the setup dialog
        public void   ShowPlugin() 
        {
           MessageBox.Show("Nothing to configure yet!");
        }  
 
        // Indicates whether plugin can be enabled/disabled
        public bool   CanEnable()  
        {
           return true;
        }  
 
        // get ID of windowplugin belonging to this setup
        public int    GetWindowId()
        {
           return 5678;
        }  
       
         // Indicates if plugin is enabled by default;
        public bool   DefaultEnabled()
        {
           return true;
        }  
       
 
 
       // indicates if a plugin has its own setup screen
        public bool   HasSetup()   
        {
           return true;
        }   
   
        /// <summary>
        /// If the plugin should have its own button on the main menu of Media Portal then it
        /// should return true to this method, otherwise if it should not be on home
        /// it should return false
        /// </summary>
        /// <param name="strButtonText">text the button should have</param>
        /// <param name="strButtonImage">image for the button, or empty for default</param>
        /// <param name="strButtonImageFocus">image for the button, or empty for default</param>
        /// <param name="strPictureImage">subpicture for the button or empty for none</param>
        /// <returns>true  : plugin needs its own button on home
        ///          false : plugin does not need its own button on home</returns>
        public bool   GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
        {
           strButtonText=String.Empty;
           strButtonImage=String.Empty;
           strButtonImageFocus=String.Empty;
           strPictureImage=String.Empty;
           return false;
        }
    #endregion
    }
}
  Reply With Quote
Old 2005-08-12, 01:05   #2 (permalink)
Portal Member
 
Join Date: Sep 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts


Default

The code looks fine to me .... now this may sound like a stupid question, but did you copy your plugin .dll file to the plugin-folder in your MP-directory?
hagur is offline   Reply With Quote
Old 2005-08-12, 01:49   #3 (permalink)
Anonymous
Guest
 
Posts: n/a


Default

Like the tutorial said, I moved the DLL to the plugins/windows folder. Ive also tried the process folder, but made no difference.

Edit: The log says: Exception in plugin loading :The format of the file 'SomePlugin.dll' is invalid.
  Reply With Quote
Old 2005-08-12, 02:56   #4 (permalink)
Portal Member
 
thechad's Avatar
 
Join Date: Feb 2005
Location: Geelong, Australia
Age: 27
Posts: 187
Thanks: 1
Thanked 0 Times in 0 Posts

Country:

My System

Default

Check the Mediaportal log and it may state why your plugin is not being found. Otherwise looks fine to me.
__________________
thechad is offline   Reply With Quote
Old 2005-08-13, 08:56   #5 (permalink)
Portal Member
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 773
Thanks: 0
Thanked 0 Times in 0 Posts


Default

The answer is simple, but its not good news:

MP works off the .NET framework 1.1, used with VS.NET 2003. C# Express 2005 (or any of the .NET IDEs with 2005 in it) compile against .NET Framework 2.0, which does not work with .NET framework 1.1. BTW, .NET Framework 2.0 is still in beta, so MP will not support it until later.

Sam
samuel337 is offline   Reply With Quote
Old 2005-08-13, 12:12   #6 (permalink)
Anonymous
Guest
 
Posts: n/a


Default

Thanks for your reply! Guess i'll have to wait then for MP to be in .NET2 :}
  Reply With Quote
Reply

Bookmarks

Tags
list, plugin, show

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[movieinfo] show a list with the actors, which you can select and view more infos chefkoch Improvement Suggestions 2 2007-12-05 22:22
Timeshift does not turn off resulting in huge file sizes broadband412 The old Bugreport Forum 18 2006-06-16 08:47
cant see list control list in my plugin kenny Plugins 1 2006-04-04 20:58
Gathering topical infos about plugins (To: authors & use tomtom21000 Plugins 2 2006-02-05 00:20


All times are GMT +1. The time now is 05:04.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden