twinBASIC Update: December 18, 2022

Highlights include initial support for user controls, a new list view option for the form designer toolbox, and another sample twinBASIC project from fafalone.

twinBASIC Update: December 18, 2022

On April 23, 2021, I helped Wayne Phillips introduce the world to twinBASIC at the Access DevCon Vienna conference.  I boldly predicted that twinBASIC (along with the Monaco editor) would replace VBA and its outdated development environment by 2025.  With that goal in mind, this weekly update is my attempt to keep the project fresh in the minds of the VBA development community.

Every Sunday, I will be providing updates on the status of the project, linking to new articles discussing twinBASIC, and generally trying to increase engagement with the project.  If you come across items that should be included here, tweet me @NoLongerSet or email me at mike at nolongerset dot com.

Here are some links to get involved with the project:


Initial Support for Internal UserControls

As announced by Wayne on Discord:

BETA 202 is out with initial support for internal UserControls. Still a lot of work to do in this area, so please bear with me whilst the work is finalized.

The VBCCR demo VBP project will now load in tB without errors, though many of the UserControls do not yet work due to a few missing parts of the puzzle (e.g. ScaleX/Y vbContainerSize support).   Due to this, the demo forms will not work yet.   You can open the demo VBP, and then create new forms to try out the controls.

The VBCCR controls that I've confirmed work (at least to some extent) are:  CheckBoxW, CommandButtonW, CommandLink, DTPicker, LabelW, LinkLabel, OptionButtonW, SpinBox, TextBoxW and UpDown.

List View for the Form Designer Toolbox

Announcement from Wayne on Discord:

With tomorrows update you can toggle between icons and a list by double clicking on the TOOLBOX caption.  There is also a new IDE setting for making the list mode be the default.  (In future, I'll add an icon for the toggle, and a search button).

Around the Web

ucShellTree v2.8: twinBASIC User Control Sample

It's another twinBASIC sample project from fafalone.  This one shows off some of the new user control features introduced just this week in twinBASIC.

Shell TreeView Control for twinBASIC (x64 compatible), ported from VB6 version.

Here's some more info from the project readme:

Beta Release

Requires twinBASIC Beta 207 or newer

User control support in twinBASIC is brand new and a work in progress, and this control is complex and a lot of testing still needs to be done. But it's basically working, so I'm posting a preview for people to check out.


Here are the updates from the past week.  You can also find this information by visiting the GitHub twinBASIC Releases page.

Releases · WaynePhillipsEA/twinbasic
Contribute to WaynePhillipsEA/twinbasic development by creating an account on GitHub.

WARNING: The following two issues are present in BETA builds 202 - 210 (the latest build as of publication):

  • building ActiveX controls is known to be broken in these builds.  Use BETA 201 instead for that feature.
  • there are known memory leaks in these versions, so memory usage will be higher than normal

BETA 202

  • fixed: Print/Write Tab(X) and Spc(X) could crash in some instances given complex inner expressions [ cjck, discord ]
  • fixed: some issues with arrays of fixed-length strings [ cjck, discord ]
  • improved: loads of ActiveXExtender and UserControl issues
  • improved: form designer stability
  • fixed: bogus compilation error when trying to Implement a custom version of IDispatch/IUnknown
  • added: VBA.Interaction.CallByDispId (equivalent to CallByName but using DISPIDs)
  • fixed: vbPixels scale mode now works correctly as per VB6, i.e. using raw pixels
  • added: vbScaledPixels scale mode to provide previous behaviour of vbPixels (dpi scaled pixels)
  • improved: VBRUN namespace is now defined in a tB package rather than internally
  • added: minimal App.LogMode support (for detecting IDE only)
  • improved: added skeleton definitions for Printer and Printers (not implemented yet)
  • fixed: some edge cases around default member handling, in particular with regards to accessing via Me
  • fixed: RaiseEvent parameter validation too strict with Variant types

BETA 203

  • fixed: UserControl Read/WriteProperties use custom versions of PropertyBag class, as per VB6 [ fafalone, discord ]
  • fixed: UserControl events Paint and Resize were wrongly marked as Unimplemented
  • fixed: UserControl Initialize event not firing
  • fixed: API declarations will now overshadow members in Implements-Via inheritance [ fafalone, discord ]

BETA 204

  • improved: UserControl Initialize event firing too early

BETA 205

  • fixed: Default values used in arguments in conjunction with the Implements-Via feature could cause compilation issues [ wqweto, discord ]
  • improved: PROBLEMS panel now offers a right-click context menu, with options of Copy/Copy All/Copy All Errors [ wqweto, discord ]
  • fixed: bogus compilation error 'expression is neither used nor assigned' when calling a Function of a dispinterface, discarding the result [ ]
  • fixed: CommandButton Value property was missing, now added with the Unimplemented attribute [ wqweto, discord ]
  • fixed: Label TabIndex property was missing, now added with the Unimplemented attribute [ wqweto, discord ]
  • fixed: some IDE panels were wrapping content inappropriately [ ]
  • fixed: App.Path now returns the IDE path when the project hasn't yet been saved [ ]

BETA 206

  • fixed: form designer was not ensuring project global variables were initialized, so user code in UserControls could fail unexpectedly
  • fixed: UserControl.Initialize was being fired too early

BETA 207

  • fixed: UserControl.ReadProperties was not being called when the property bag was empty (for a not-new control)
  • fixed: UserControl.Resize event firing multiple times during initialization
  • fixed: DefXyz statements were wrongly affecting Const's without explicit datatypes [ wqweto, discord ]
  • fixed: use of Ax control datatypes will now automatically refer to the extended versions, as per VBx [ wqweto, discord ]

BETA 208

  • added: IDE option 'IDE: Show toolbox icons only' (default true)
  • improved: double clicking on the "TOOLBOX" header in the form designer temporarily toggles icon-only mode
  • added: support for overriding COM library names, via the project References list
  • added: support for referencing a type library without automatic wrapping of its ActiveX controls, via the project References list
  • fixed: LongPtr in event definitions would come through as the resolved Long/LongLong type in auto generated signatures [ ]

BETA 209

  • fixed: bogus 'validation of call' errors when a default member of a UDT field is passed to a ByRef argument of mismatching type [ wqweto, discord ]
  • improved: IDE error hover popup text is now selectable and copyable
  • fixed: SelectCase-Is expression handling to better handle edge cases [ wqweto, discord ]
  • fixed: ByRef-Variant assignment passthru to uninitialized array edge case crash [ wqweto, discord ]
  • improved: IDE Alt key behaviour [ wqweto, discord ]

BETA 210

  • fixed: (regression) form designer issue sometimes preventing F5/Run from working without a compiler restart [ sokinkeso, discord ]

All original code samples by Mike Wolfe are licensed under CC BY 4.0