The MP3car.com Store The MP3car.com Store    

Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Front Ends > StreetDeck > DigitalMods (Scripts / API)

Reply
 
LinkBack Thread Tools Display Modes
Old 03-10-2008, 09:14 AM   #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?
PhatStu is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 03-10-2008, 09:39 AM   #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.
PhatStu is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

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 Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
RRTMS - RoadRunner tire monitoring system extension plugin Robby BMW RR Plugins 85 09-15-2008 05:48 AM
DJiK's Jump-to-File External Control Plugin, v0.99b [BETA] DJiK RR Plugins 119 12-25-2007 02:20 PM
Infill G4 stopped working haiminger Centrafuse 12 11-11-2007 02:54 PM
Hello World plugin paulpv CF Plugins 5 06-08-2006 10:07 PM
How do I setup the CD Rip plugin ? guino RR FAQ 1 09-21-2005 11:38 AM


All times are GMT -5. The time now is 09:10 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics