Do you know how to convert the Delphi example in vb.net to test it in Visual Basic Express 2005?
How do I create the SongsDB.SDBApplication object?
any .NET developers here?
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
.NET and Events
I wrote my podcast plugin using .NET, the only way I could get events to work was using a vbscript to hook the events into the .NET object. This works pretty well (even if it is unpleasantly hacky), you just have to make sure the .net assemblies are compiled with COM interfaces too.
This is the autorun script from mmPodcasts - the events handlers are set from within the .NET code: OnChangedSelection must not have a script property, so it has to be hooked from here:
This is the autorun script from mmPodcasts - the events handlers are set from within the .NET code: OnChangedSelection must not have a script property, so it has to be hooked from here:
Code: Select all
' Blurb
Option Explicit
Sub onStartUp
dim podcasts, podcastOptions
set podcasts = CreateObject("mmPodcasts.PodcastsPlugin")
set SDB.objects("PodcastsPlugin") = podcasts
podcasts.init SDB, Script
' Register event handlers
Script.RegisterEvent SDB, "OnChangedSelection", "handleChangedSelection"
End Sub
' Retrieves the PodcastsPlugin object
Function podcasts()
set podcasts = SDB.objects("PodcastsPlugin")
End Function
''''''''''''''''''''''''''''''''''''
' Event Handlers
''''''''''''''''''''''''''''''''''''
Sub handleUpdateDirectory(control)
podcasts().updateDirectory
End Sub
Sub handleDownloadPodcasts(control)
podcasts().downloadPodcasts
End Sub
Sub handleFillTracks(node)
podcasts().populateChannel
End Sub
Sub handleChangedSelection
podcasts().selectionChanged
End Sub
Sub handleImport
podcasts().importOPML
End Sub
Sub handleExport
Msgbox "Handle Export"
podcasts().exportOPML
End Sub