twinBASIC Update: June 16, 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:


Highlights

New [Flags] Attribute for Automatic Bitwise Enums

Creating enumerations for bitwise flags is now effortless with the new [Flags] attribute, which automatically assigns power-of-two values for you.

Spun from a developer suggestion on Discord, this feature addresses the common but tedious task of defining bit flags. By simply adding [Flags] above an Enum block, the compiler will assign sequential power-of-two values (1, 2, 4, 8, ...) to any member that does not have an explicit value. This makes the code cleaner and much easier to maintain than manually calculating values with bit-shifting. To prevent ambiguity, the compiler enforces a simple rule: once you explicitly assign a value to an enum member, all subsequent members must also be given explicit values.

' The [Flags] attribute automatically assigns power-of-two values
[Flags]
Public Enum FileAccess
    Read      ' Compiler auto-assigns 1
    Write     ' Compiler auto-assigns 2
    Execute   ' Compiler auto-assigns 4
End Enum

' You can still combine flags as usual
Dim ReadWrite As FileAccess
ReadWrite = FileAccess.Read Or FileAccess.Write

Here are Wayne's comments on the new feature:

Now available in BETA 803. Note that once you've set a member with an explicit value (e.g. None in the example below), then all further members must have explicit values set, else it will be a compiler error. I did this to avoid possible confusion in how the automatic bit values might be allocated in such cases.

Of course, having the inline decorations always visible is particularly helpful here

*Recap generated by Gemini-2.5-Pro based on Discord chat transcript.

WinDevLib v9 Released

fafalone released a new major version of his excellent Windows Development Library project.

WinDevLib: A Better Way to Call Windows API Functions in twinBASIC
Stop struggling to declare your Windows API calls in twinBASIC. Use the Windows Development Library twinPACK and let fafalone do all the hard work for you.

Here's an AI-generated recap of the v9 changelog:


WinDevLib Recent Updates Summary

Comprehensive DirectShow and DirectDraw Support - Added complete coverage of DirectShow interfaces (strmif.h, dvdif.h) and DirectDraw APIs (ddraw.h, ddstream.h), plus legacy video mixer interfaces and DXVA types

New Modular Compilation Flags - Introduced WDL_NO_DIRECTX flag to exclude DirectX technologies and streamlined other compiler flags with shorter names (e.g., WINDEVLIB_LITEWDL_LITE)

Enhanced D3DX Coverage - Expanded Direct3D extensions with additional headers including mesh, shape, and math functionality

twinBASIC Version Compatibility - Added conditional compilation for newer twinBASIC features, requiring Beta 797+ for certain functions while maintaining backward compatibility

Bug Fixes - Resolved x64 union padding issues in STRRET and corrected GUID function definitions that were returning null values


Discord Chat Summary

* Auto-generated via Claude-3.7-Sonnet

Overview

This week showcased twinBASIC's growing maturity with significant milestone achievements and strong community support for newcomers. The channel saw extensive discussion around database integration, particularly SQLite implementation, while celebrating major project successes including the first 64-bit compilation of XYplorer. Community engagement remained high with detailed technical guidance and troubleshooting support.

Major Milestones & Success Stories

  • kismertwise achieved compilation of a massive 260K line ActiveX DLL after incremental tB updates, marking a significant milestone for large legacy codebase migration
  • twixydon announced the first-ever 64-bit version of XYplorer compiled successfully, enabling full support for 64-bit shell extensions, preview handlers, and codecs
  • waynephillipsea acknowledged the collaborative nature of these achievements, emphasizing the team effort behind tB's development

Database Integration & SQLite Implementation

  • Extensive discussion around SQLite as the preferred lightweight database solution for tB applications, with waynephillipsea recommending it over Access dependencies
  • Sample 17 (SQLite3 static library example) highlighted as the starting point for database integration
  • ODBC driver configuration and deployment considerations addressed, including licensing terms for commercial distribution
  • bclothier provided technical insights on SQLite's single-writer, multiple-reader design constraints

Community Support & Learning Resources

  • gtaiv received comprehensive guidance transitioning from VBA/Excel to tB, with community members providing patient step-by-step assistance
  • fafalone emphasized tB's stability for new projects despite beta status, citing PhotoDemon and XYplorer as examples of complex applications already working
  • Discussion of VB6 compatibility as the foundation for learning tB, with AI tools proving effective for generating compatible code

Language Compatibility & Development

  • krool5045 and bclothier identified VB6 limitations that tB has resolved, such as ReDim functionality on function return variables
  • antsantix advocated for maintaining tB improvements over VB6 where they don't break compatibility
  • Control differences between VBA and VB6 clarified, with ListView and VBFlexGrid recommended for multi-column data display

Conclusion

The week demonstrated twinBASIC's readiness for serious development work, with major applications successfully compiling and running in 64-bit mode. The community's collaborative approach to supporting newcomers, combined with practical database integration solutions, reinforces tB's position as a viable modern successor to VB6/VBA. The successful compilation of large legacy codebases and the achievement of 64-bit XYplorer compilation represent significant validation of the platform's maturity and capabilities.

Around the Web

XYplorer Goes 64-bit With the Help of twinBASIC

From the twinBASIC Discord:

Windows Hello Demo

Posted in show-and-tell by VanGoghGaming:

This project demonstrates the usage of "Windows Hello" in WinRT to verify the identity of a user (by means of entering the user's PIN or biometrics such as fingerprint scanner or face recognition if available).

The source code is available here.

How to obfuscate VBA code?

From reddit:

I would like to know how I can obfuscate VBA code. I want the code to work but to be difficult to read.

Multiple mentions of twinBASIC in the discussion, including this near the top of the post:

...anyone can extract the PCode and reverse the real code from that relatively easily.

The real recommendation to protect code is likely compile an ActiveX library/DLL from TwinBasic.

Changelog

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.

AI-Generated Changelog Summary

* Auto-generated via Claude-3.7-Sonnet, sorted in order of its opinion of "most impactful changes."

  • Added [Flags] attribute support for Enums - Automatically assigns unique bit-values to enumeration members, enhancing enum functionality for bitwise operations

  • Enhanced internationalization - Added Portuguese and Japanese language packs, expanding accessibility for international developers

  • Improved debugging experience - Code execution and debugging now properly runs on the main thread, resolving compatibility issues with certain controls like CodeJock

  • Fixed critical operators - Resolved LongLong right shift operator issues in Win32 final builds, ensuring proper arithmetic operations

  • Enhanced ActiveX support - Improved license key handling for ActiveX controls that contain embedded null characters

  • Better development experience - Fixed inline code decorations visibility in light themes and improved error reporting for enumerations in the diagnostics panel


WARNING: The following issues are present in BETA builds 623 - 806 (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: 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 803

  • fixed: errors in enumerations would not always appear in the DIAGNOSTICS panel, only appearing when the source document was open
  • added: support for [Flags] attribute on Enums, giving members automatic unique bit-values [ FullValueRider, discord ]
  • fixed: inline decorations in the code editor were barely visible in the light themes

BETA 804

  • fixed: OLEDragDrop event not always firing in win32 builds [ Tecman, discord ]

BETA 805

  • fixed: special case of PropertyBag serialization of 0x0 StdPicture objects [ Tecman, discord ]
  • fixed: LongLong right shift operator broken in final builds on Win32 architectures
  • added: 2 language pack (Portuguese, Japanese)
  • special thanks to our community members for the new/updated language packs (admbrnunes, cycle40)

BETA 806

  • fixed: support for ActiveX licence keys that use null chars embedded into the string
  • fixed: general code execution and debugging now happens on the real main thread when debugging to fix problems with some controls (e.g. CodeJock) [ Kimpos, private ]
  • fixed: some edge cases around MDI children without titlebars, causing potential infinite loop in form engine [ Kimpos, private ]