noob question - writing a plugin in VB

Discussion in 'MediaPortal 1 Plugins' started by ghackett, November 23, 2005.

  1. ghackett

    ghackett Portal Member

    Joined:
    May 9, 2005
    Messages:
    30
    Likes Received:
    0
    Location:
    NYC
    Ratings:
    +0 / 0
    Hi guys, I know that C# is the preferred language for mediaportal, but I am, by trade, an ASP.NET Webb App programmer, and I work completely in VB. I'm trying to write my first plugin in VB mainly because I already have a bunch of code I want to use in it and I dont want to have to port it all over to C#. Anyway, I'm going over your "My First Plugin tutorial and encountering a problem. Can anyone with some VB experience help me out? I think that once I get past this hump, I can finish the rest on my own.

    I ported the beginning of the OurPlugin code over to VB, but I'm having probles impletemnting some of the (all of the) functions without the override tag. VS is telling me that I need to implement the Overrideable functions Description(), Author(), etc... in order to implement ISetupForm, but I have implemented those classes. When I add the Overrides tag to any of those classes though, I get an error saying that there is no class to override.



    here is my code (it currently does nothing)
    Code (Text):
    1.  
    2. Imports System
    3. Imports System.Windows.Forms
    4. Imports MediaPortal.GUI.Library
    5.  
    6. Namespace MyRandomVideo
    7.  
    8.     Public Class RandomVideo
    9.         Inherits GUIWindow
    10.         Implements ISetupForm
    11.  
    12.         Public Sub New()
    13.  
    14.         End Sub
    15.  
    16. #Region "ISetupForm Members"
    17.  
    18.         Public Function PluginName() As String
    19.             Return "My Random Video"
    20.         End Function
    21.  
    22.         Public Function Description() As String
    23.             Return "Play Random Videos From Selected Folders"
    24.         End Function
    25.  
    26.         Public Function Author() As String
    27.             Return "GHackett"
    28.         End Function
    29.  
    30.         Public Sub ShowPlugin()
    31.             MessageBox.Show(Application.StartupPath)
    32.         End Sub
    33.  
    34.         Public Function CanEnable() As Boolean
    35.             Return True
    36.         End Function
    37.  
    38.         Public Function GetWindowId() As Integer
    39.             Return 5678
    40.         End Function
    41.  
    42.         Public Function DefaultEnabled() As Boolean
    43.             Return True
    44.         End Function
    45.  
    46.         Public Function HasSetup() As Boolean
    47.             Return True
    48.         End Function
    49.  
    50.         Public Function GetHome(ByRef strButtonText As String, ByRef strButtonImage As String, ByRef strButtonImageFocus As String, ByRef strPictureImage As String) As Boolean
    51.             strButtonText = PluginName()
    52.             strButtonImage = String.Empty
    53.             strButtonImageFocus = String.Empty
    54.             strPictureImage = String.Empty
    55.             Return True
    56.         End Function
    57.  
    58.         Public Overrides Property GetID() As Integer
    59.             Get
    60.                 Return 5678
    61.             End Get
    62.             Set(ByVal Value As Integer)
    63.  
    64.             End Set
    65.         End Property
    66.  
    67.         Public Overrides Function Init() As Boolean
    68.             Return Load(GUIGraphicsContext.Skin + "\MyRandomVideo.xml")
    69.         End Function
    70.  
    71. #End Region
    72.  
    73.  
    74.     End Class
    75. End Namespace
    76.  
    VS 2003 puts a squggly blue line underneath ISetupForm at the top and gives me laundry list of errors when i try to compile telling me that I dont implement the proper functions. Any help would be appreciated.

    P.S. I would use C# but VB is just so much easier to write. DAMN M$
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. ghackett

    ghackett Portal Member

    Joined:
    May 9, 2005
    Messages:
    30
    Likes Received:
    0
    Location:
    NYC
    Ratings:
    +0 / 0
    Sorry

    Sorry to waste your time guys, just found source for a VB plugin

    thanks
     
  4. weekendowel

    weekendowel Portal Member

    Joined:
    September 5, 2005
    Messages:
    31
    Likes Received:
    6
    Location:
    Stockholm
    Ratings:
    +7 / 0
    Home Country:
    Sweden Sweden
    Re: Sorry

    Could you please tell everyone else where to find that source
     
  5. ghackett

    ghackett Portal Member

    Joined:
    May 9, 2005
    Messages:
    30
    Likes Received:
    0
    Location:
    NYC
    Ratings:
    +0 / 0
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!