Integrating ConnectBasic is designed to be easy, here is an example from the sample in the ConnectBasic source:

// First time?
if (mHost == null)

    // Initialize the shell
    mHost = ShellFactory.CreateHost();

    // Create the project we're going to load into the host
    var projectStore = new OpenXmlFileProjectStore("Q:\\Hello.macro", System.IO.FileMode.CreateNew);
    var project = mHost.Projects.LoadProject(projectStore);

    // Add a standard module by default
    project.Items.Add("Module1", WellKnownItemTypeNames.StandardModule);

// Show the shell

The principal stages here are:
  • Create a Shell Host
  • Create an instance of an implementation of the IProjectStore interface (different host programs might want to store macros in different ways, e.g. file system, embedded in another file, etc)
  • Setup the project (e.g. create a default code file to make it easy for the user to get started)
  • Show the shell

ConnectBasic is basically divided into three separate assemblies:
  • ConnectBasic.dll - this is the ConnectBasic language
  • ConnectDebug.dll - provides support for instrumenting DLR-based languages for interactive debugging.
  • ConnectBasicShell.dll - provides the ConnectBasic Macro Editor

As far as integration goes, the most important of these is ConnectBasicShell.dll, this is divided into two public namespaces:
  • ConnectBasic.Shell.Hosting - provides support for hosting the shell inside an application
  • ConnectBasic.Shell.Extensibility - provides an API for working with the shell, this is used both by the hosting application, and, at the discretion of the hosting application, by macros and possibly plugins.

Last edited Jun 8, 2009 at 5:25 PM by PhilipStears, version 2


No comments yet.