Getting ready

Top  Previous  Next

This is a first brief explanation on how to develop a BLIde Plug-in using the BLIde SDK.

 

Those are the prerequisites for this process:

 

  1. BLIde Plus 00.09.91-A or greater.

 

  1. Visual Basic Express Edition 2008 or greater (a tutorial based on C# is planed and will be published later). The Visual Basic Express Edition 2008 can be freely downloaded from the Microsoft website. It's free.

 

First of all, while I was trying to create an easy step-by-step guide on how to integrate Visual Studio with the BLIde SDK framework, I noticed there was not an easy and simple step by step way of integrating things. The simplest integration required about 100 lines of code and a considerable knowledge about .net reflection and assemblies.

 

In order to make SDK development easy and powerful, 2 things where implemented in BLIde:

 

a)      A BLIde VSIntegration framework that does most of the low level reflection based work (so it is very easy to write a BLIde plug-in using Visual Studio).

 

b)      A pre built Visual Basic solution with an empty plug-in that can be used as a template.

 

The VSIntegration framework is part of the internal BLIde core, so in order to get it; all you need is a properly installed version of BLIde Plus. It is highly recommended to install this copy of BLIde Plus to the default “c:\Program files\Blide for blitzmax” location.

 

Then, the pre built Visual Basic solution can be downloaded here: http://www.blide.org/sdk/BLIdeSDKProject.rar

 

Unrar this file to any destination on your system. (the user documents folder is highly recommended on system with User Account Control systems like Vista or Windows 7).

 

When you unrar this package, you’ll see a solution file called: BLIdePluginDevelopment.sln Double click this file to open it on Visual Basic 2008. (for more information about this solution template see here).

 

first load of the SDK template

 

solutionload

 

As you can see, the first thing we see when the solution is open is the Project properties of the Plugin. Be sure that the first reference (BLIde) is not marked as ‘unresolved’. If you’ve installed BLIde on "c:\program files\BLIde for blitzmax\" it’ll be automatically resolved. Otherwise, you will have to select the unresolved BLIde reference, remove it, and then add it again from the proper BLIde path. In this case, be sure to set the copy local property to false.

 

Then, it is a good idea to select the Application tab in the same Plug-in window:

 

Application

 

Application tab on SDK solutions

 

In this window, it is a good idea to give the Plug-in assembly a name. This will be the name of the plug-in. It has to end with .sdk If you don’t end it with .sdk, it won’t work!

 

By default the plug-in will be name untitled.sdk

 

Also, notice how the root namespace is left blank. This is also mandatory. Otherwise the plug-in will not be compatible with BLIde.

 

When this is done, we can close the plug-in project properties window, and select the file BLIde Launcher.vb

 

This is the contents of the file:

 

 

'Modify this const according to your BLIde installation and plugin name:  

Const BLIdeLocation As String = "C:\Program files\Blide for blitzmax\BLIde.exe"   

Const PluginName As String = "untitled.sdk"  

 

 

We should modify the BLIdeLocation const (if BLIde is not “c:\Program files\Blide for blitzmax\BLIde.exe”), and also we should modify the PluginName const, with the name of the plugin we’ve set in the previous step (in the Plug-in Assembly name window).

 

After changing this constants (if needed), we can close the BLIde Launcher.vb file and see the PlusingModule.vb file. This file contains the Plugin source code that, by default contains the code to display a hello world message box:

 

Imports BLIde.SDK

Public Module Plugin

   Sub Main()

      IO.Msg("If you see this message, you've set up the VS project properly!", "Hello world!")

   End Sub

End Module

 

If you press F5, you should see how the SDK launches BLIde with this plugin, and BLIde shows the Hello World message at start-up.

 

When this is done, save this solution as your template solution and start any new plugin using this as a base template, in order to make your life easier as a BLIde developer. This base template will be called Empty Plugin Template in the Tutorials.