twinBASIC Update: March 4, 2025
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 Monday week, 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, please leave a comment below.
Here are some links to get involved with the project:
- Custom twinBASIC IDE Installation Guide
- twinBASIC Discord Server (chat about the project)
- twinBASIC Wiki (list of new features not in VBx)
- GitHub Issue Tracker (report bugs)
- twinBASIC/VBx LinkedIn Group
Highlights
High-Priority Bug List
This week saw a concerted effort from Wayne to aggressively tackle the remaining compatibility bugs on the List of high priority bugs: VBx compatibility and tB code execution.
Wayne posted the following on Discord on 25 Feb 25:
That's me done for at least a day (perhaps two) on high-priority bugs list: https://github.com/twinbasic/twinbasic/discussions/2010 Please help us out by retesting your old bug reports folks, and comment on them once you've confirmed they are still reproducible. Once confirmed, we'll add them to the the high-priority list (if apprioriate) for the next push in a few days.
Current Project UserControls Now Active Again
The release notes for BETA 623 - 699 included the following warning:
KNOWN ISSUE: UserControls from the ACTIVE project will not appear correctly in the form designer in this release (they are purposely disabled until next release). Packaged controls, such as VBCCR will work.
As of BETA 700, that issue has been resolved:
fixed: UserControls from the ACTIVE project are no longer disabled in the form designer (there may be quirks in this)
Wayne elaborated in Discord:
UserControls from the current project are now active again in the form designers as of BETA 700. There will be some minor differences noticeable in the form designer for forms that host in-project UCs. In particular you'll see the form designer show the "Syncing..." progress bar more often (e.g. when adding/removing controls), this is because such changes trigger a background project recompilation, and then the form designer has to reload the form to get new instances of the newly compiled UCs. Once we have Edit & Continue supported, this will become much more slick.
Expect some minor issues with editing forms that host in-project UCs for the next few releases until we iron out some issues.
Discord Chat Summary
* Auto-generated via Claude-3.5-Sonnet-200k on poe.com
Overview
This week saw significant developments in twinBASIC's IDE features and compatibility, with the restoration of UserControl functionality in form designers and discussions around error handling behaviors. The community engaged in detailed technical discussions about IDE improvements, resource handling, and VB6 compatibility features, while also helping each other with migration challenges.
IDE & Development
- UserControls from current projects are now active again in form designers as of BETA 700, though Wayne notes some minor issues will need ironing out in upcoming releases (waynephillipsea)
- The IDE's control selection behavior differs positively from VB6, allowing easier selection of controls within containers (sokinkeso)
- A bug affecting picture refresh behavior was identified and quickly fixed in BETA 705 (waynephillipsea)
Language Features & Compatibility
- Wayne confirmed that Edit & Continue (E&C) preliminary work is underway and will offer capabilities beyond typical compiled language limitations (waynephillipsea)
- Global.LoadPicture now accepts byte arrays directly from LoadResData, enabling PNG support in ways VB6 couldn't handle (waynephillipsea)
- The team identified a behavioral difference with Option Explicit and variable declarations that needs alignment with VB6 standards
Error Handling & Debugging
- Discussion around "Break on All Errors" highlighted tB's improved error handling compared to VB6's interface limitations (wqweto)
- Wayne completed work on high-priority bugs list and requested community help in retesting old bug reports for verification
Community Support
- Several community members collaborated on resource handling solutions, particularly around loading PNG images in various contexts
- Detailed discussions about IDE designer improvements drew from professional design tool experiences
- Multiple successful migration stories were shared, including complex sensor data implementations
Conclusion
The week demonstrated twinBASIC's continued evolution toward production readiness, with significant progress on UserControl support and bug fixes. The community's deep technical discussions and collaborative problem-solving showed strong engagement with the project's development. Wayne's confirmation of E&C development and the quick response to identified issues reinforces the project's commitment to both compatibility and modern development features.
Around the Web
AmbientLightMonitor: Using device sensors in tB
Another impressive tB project from fafalone as shared in Discord:
.This shows how to use ISensor/ISensorManager to get a feed of raw, live sensor data from the accelerometers, gyroscopes, magnetometers, etc, and here, ambient light sensors, commonly found on tablets and laptops. I tested this on my Surface Go 2 tablet.
At the center is a class designed to be portable to other projects; to use it all you need to do is instantiate, call Initialize to start and Uninitialize when finished, and it will deliver AmbientLightChanged events, with the illuminance in lux, every time the sensor updates. I thought this might be useful as an actual utility for non-programmers too, so cleaned up the UI and added a few features to polish it; so the project repository has binary builds.
Much more detail in the full readme and class.
Sometimes fafalone makes it look so easy he even surprises himself:
Extract zip files very simply through Windows shell
Also posted by fafalone in the Discord show-and-tell channel:
Really just a code snippet but I wrote a short demonstration program of a really short and easy way to extract a zip file by using Windows' built in ability to treat it like a folder. Some might find it useful.
https://github.com/fafalone/ExtractZipShell
twinBASIC Resources on NoLongerSet.com
For those readers who may be somewhat new to twinBASIC and this website, here are a few practical resources and popular articles that you may not be aware of:
- HOW TO: Creating an Office COM Add-in with twinBASIC
- HOW TO: Handle Excel Events in a twinBASIC COM Addin
- HOW TO: Create a Custom ActiveX Control with twinBASIC
- HOW TO: Create a Tool Window in the VBIDE with twinBASIC
- HOW TO: Creating a Standard (non-ActiveX) DLL with twinBASIC
The following tag pages include all the articles I've written on twinBASIC:
Changelog
Here are the updates from the past week. You can also find this information by visiting the GitHub twinBASIC Releases page.
AI-Generated Changelog Summary
* Auto-generated via Claude-3.5-Sonnet, sorted in order of its opinion of "most impactful changes."
Here's a concise summary of the most significant updates in twinBASIC from this changelog:
-
Form Control Improvements: Major fixes to form-related functionality, including proper IOleWindow implementation, KeyPreview feature for common controls, and corrected resize event handling to prevent infinite loops with anchored controls.
-
Property Browsing & Designer: Resolved regression issues with IPerPropertyBrowsing, improved form designer performance for complex forms, and enhanced property editing features like auto-focus for list entries.
-
Performance Optimizations: Refined graphics methods to reduce flickering through partial HWND invalidation, and reduced unnecessary recompiles during form designer changes.
-
Control Behavior Fixes: Addressed issues with UserControl destruction/recreation, visual glitches in semi-transparent controls, and ProgressBar visual styles handling at runtime.
-
Array Handling: Fixed ReDim Preserve validation to properly check lower bounds changes, and added support for Object to byte-array assignment via default member access.
These updates demonstrate continued progress in achieving VB6/VBA compatibility while enhancing the development experience with modern features and optimizations.
WARNING: The following issues are present in BETA builds 623 - 707 (the latest build as of publication):
- IMPORTANT: This is an interim/experimental release. It includes significant changes, so some instability is to be expected. [Editor's Note: Rolling back to BETA 622 may be necessary if any of the KNOWN ISSUES below affect your project.]
- KNOWN ISSUE: Menus currently not appearing in MDI Forms (broken in this build)
- KNOWN ISSUE: 'Scale*' properties are often not settable in the IDE property sheet (broken in this build)
- KNOWN ISSUE: Setting Width/Height via the property sheet often does not work correctly (broken in this build)
- KNOWN ISSUE: Controls are not being destroyed properly by the form designer, causing big memory leaks (broken in this build)
- there are known memory leaks in these versions, so memory usage will be higher than at the Version 1.0 release
BETA 697
- fixed: re-opening a form multiple times could cause problems due to incomplete destruction [ kimpos, discord ]
- fixed: visual glitching of semi transparent controls in a Frame in some circumstances [ https://github.com/twinbasic/twinbasic/issues/1346 ]
- fixed: Form now implements IOleWindow to match VBx [ https://github.com/twinbasic/twinbasic/issues/1745 ]
BETA 698
- fixed: Form KeyPreview feature not working for some of the common controls in WinNativeCommonCtls package [ https://github.com/twinbasic/twinbasic/issues/1900 ]
- fixed: (regression) some AX properties that use IPerPropertyBrowsing were not changable in the form designer [ https://github.com/twinbasic/twinbasic/issues/2039 ]
- updated: project template 'Standard EXE (plus VBCCR)' to include VBCCR18 v1.8.0.58
- fixed: package version check when loading a project could cause IDE lockup if internet connection unavailable [ Greedo, discord ]
- fixed: (regression since 695) some UserControls would crash due to changes in the IEnumVARIANT::Next handling, and the internal UserControl implementation being non-spec-compliant
BETA 699
- fixed: issue when setting ProgressBar.VisualStyles property at runtime [ https://github.com/twinbasic/twinbasic/issues/1766 ]
- fixed: TreeView.HitTest coord args are now ByVal to match MS common controls [ https://github.com/twinbasic/twinbasic/issues/1737 ]
- fixed: ReDim Preserve failed to validate the lower bounds hasn't changed [ https://github.com/twinbasic/twinbasic/issues/1725 ]
BETA 700
- fixed: UserControls from the ACTIVE project are no longer disabled in the form designer (there may be quirks in this )
- improved: many form designer changes no longer trigger a recompile of the project in the background
BETA 701
- fixed: changing a control coordinates inside Form_Resize event could trigger an endless loop if the control has anchors or docking set [ https://github.com/twinbasic/twinbasic/issues/2049 ]
- fixed: (regression since BETA 685) 'Error$' throws a compilation error [ bradPeg, discord ]
- fixed: some minor IPerPropertyBrowsing issues in the form designer [ https://github.com/twinbasic/twinbasic/issues/2039#issuecomment-2687662920 ]
- added: generic built-in function [_HiddenModule].GetDeclaredTypeIid and GetDeclaredTypeEventIid, e.g. GetDeclaredTypeIid(Of Access.Form) to obtain a string representation of the Access.Form interface IID
- added: built-in function [_HiddenModule].RuntimeInteractionRaiseEventByNameAndIID same as RuntimeInteractionRaiseEventByName, but requires an explicit event IID [ https://github.com/twinbasic/twinbasic/issues/2031 ]
BETA 702
- fixed: Object to byte-array assignment now supported, via default member access [ zx81sp, vbforums ]
BETA 703
- improved: refined graphic methods (Line/Circle/PSet) to do partial HWND invalidation to prevent excessive repainting/flickering [ XYplorer, private ]
- fixed: when SetTextColor API is used to change Form/PictureBox HDC text color manually, changing a Font property would resync the text color to the Form/PictureBox ForeColor property unlike VBx [ XYplorer, private ]
- fixed: focus rectangles in CheckBox and other controls sometimes not rendering correctly [ XYplorer, private ]
- fixed: changing HWND coords via API such as SetWindowPos could cause control layout issues [ XYplorer, private ]
- improved: lock/unlock controls in the form designer was slow for complex forms [ XYplorer, private ]
- fixed: closing the code EDITOR panel causes IDE startup error on next run [ KarlSevenSeven, discord ]
BETA 704
- fixed: (regression) form designer Width property would slightly decrease when resyncing for some values of BorderStyle [ fafalone, discord ]
- fixed: form designer property sheet
(add)
entries for ListBox/ComboBox List would not auto-focus the new entry for input [ sokinkeso, discord ] - fixed: IDE error 'Language id "vs.editor.nullLanguage" is not configured nor known' when editing markdown file with code blocks [ fafalone, discord ]
BETA 705
- fixed: tweaked AutoRedraw behaviours [ Brooks, discord ]
BETA 706
- fixed: tweaked TAB key behaviours for better handling of invisible controls and controls created via API [ XYplorer, discord ]
BETA 707
- improved: '(add)' entry in the form designer for lists is now works more reliably [ sokinkeso, discord ]
- fixed: edge case of code editor auto case correction gone wrong [ https://github.com/twinbasic/twinbasic/issues/2055 ]
- fixed: UserControl_Resize wouldn't always fire in some circumstances [ Tecman, discord ]