Page 2 of 2

Posted: Tue Sep 04, 2007 2:18 pm
by holterpolter
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?

Posted: Tue Sep 04, 2007 3:19 pm
by Steegy
Hey

First take a look in the wiki.

Posted: Thu Sep 06, 2007 2:29 pm
by G.I.
I program a lot in .Net, but I have only experience in (little bit of) windows / (plenty of) web applications that are on it's own. Not plugins or any other application that uses winapi or other windows applications... so I am not sure if I am much help. But if you want some, just let me know :)

.NET and Events

Posted: Fri Sep 14, 2007 5:04 pm
by Mike H
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:

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