Results 1 to 2 of 2

Thread: Getting plugin working with VB.NET

  1. #1
    Newbie
    Join Date
    Mar 2008
    Posts
    7

    Getting plugin working with VB.NET

    I've been trying to get a sample plugin working with VB.NET (VS 2005), using the sample C# code as a basis. I can get SD to register and load the plugin, but can't get it to register event handling (OnExec) and wonder if I'm missing a trick.

    I've tried both creating delegates and adding event handlers, neither of which seems to result in my event being fired.

    Code:
    Imports system.runtime.InteropServices
    Imports SD = StreetDeck
    
    Public Class SDPlugin
    
        Implements StreetDeck.IDualStreetDeckAddin
    
        Private Const ModuleName As String = "SamplePlugin"
        Private SDApp As SD.StreetDeckApp
        Private SDModule As SD.ScriptModule
        Private SDOverlay As SD.ScriptOverlay
    
        Delegate Function SDOnExec(ByVal Description As String, ByVal eEM As StreetDeck.enumExecMessage, ByVal wParam As Integer) As Boolean
        Private SDOnExecDelegate As SDOnExec
    
        Public Sub OnConnection(ByVal Application As Object, ByVal eConnectMode As StreetDeck.enumAddinConnectMode) Implements StreetDeck.IDualStreetDeckAddin.OnConnection
    
            SDApp = Application
            SDModule = SDApp.CreateModule(ModuleName)
    
            Dim btnShowOverlay As SD.Panel = SDModule.CreatePanel(StreetDeck.enumCreatePanelType.eCPTButton, "BUTTON.LISTITEM_HIGH", "ShowOverlay", SDApp.GetSystemMetric(StreetDeck.enumSystemMetrics.eSMGenericModuleClientX), SDApp.GetSystemMetric(StreetDeck.enumSystemMetrics.eSMGenericSettingsModuleClientY), 200, 200)
            btnShowOverlay.Caption = "Show Overlay"
    
            SDOverlay = SDApp.CreateOverlay("OverlayTest")
    
            SDOnExecDelegate = New SDOnExec(AddressOf On_Exec)
            SDModule.onexec = SDOnExecDelegate
    
            'AddHandler SDOverlay.OnExec, AddressOf On_Exec
    
        End Sub
    
        Public Sub OnDisconnect() Implements StreetDeck.IDualStreetDeckAddin.OnDisconnect
    
        End Sub
    
        Private Function On_Exec(ByVal Description As String, ByVal eEM As StreetDeck.enumExecMessage, ByVal wParam As Integer) As Boolean
    
            If Description.ToUpper = "SHOWOVERLAY" Then
                If eEM = StreetDeck.enumExecMessage.eEMSelect Then
                    SDOverlay.Visible = Not (SDOverlay.Visible)
                    SDOverlay.MsgBoxEx("Overlay visibility changed!", "Button Clicked", StreetDeck.enumMsgIconType.eMsgIconAlert, 1)
                End If
            End If
    
            Return False
    
        End Function
    
    
    End Class
    Can anyone shed any light as to why this isn't working?

  2. #2
    Newbie
    Join Date
    Mar 2008
    Posts
    7
    Well, using the delegate approach doesn't seem to work. But if I use the right variable for the addhandler, it works fine.

Similar Threads

  1. RRTMS - RoadRunner tire monitoring system extension plugin
    By Robby BMW in forum RR Released Plugins
    Replies: 251
    Last Post: 11-29-2013, 04:25 PM
  2. How do I setup the CD Rip plugin ?
    By guino in forum RR FAQ
    Replies: 2
    Last Post: 12-18-2008, 07:28 AM
  3. Replies: 119
    Last Post: 12-25-2007, 02:20 PM
  4. Infill G4 stopped working
    By haiminger in forum Centrafuse
    Replies: 12
    Last Post: 11-11-2007, 02:54 PM
  5. Hello World plugin
    By paulpv in forum CF Plugins
    Replies: 5
    Last Post: 06-08-2006, 10:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •