twinBASIC Update: December 24, 2024

Highlights include the long-awaited release of BETA 623 (with major improvements to VB6 compatibility) and the announcement of a new twinBASIC Gold Sponsor: XYplorer.

twinBASIC Update: December 24, 2024

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

IT'S HERE!!! BETA 623 Just Released a Few Hours Ago

From Wayne in Discord:

Right, so BETA 623 is (finally) out. Please note the warnings at the top of the release notes:

  • IMPORTANT: This is an interim/experimental release. It includes significant changes, so some instability is to be expected.
  • 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.
  • 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)

(and there will be more regressions for sure)

Release twinBASIC BETA 623 · twinbasic/twinbasic
Wishing everyone a joyful holiday season! Please accept my apologies for the delay in getting this out. IMPORTANT: This is an interim/experimental release. It includes significant changes, so some…

Check out the Changelog summary and full changelog below for details about the release.

Discord Chat Summary

* Auto-generated via Claude-3.5-Sonnet-200k on poe.com

Here's the structured summary of the twinBASIC Discord general channel discussions from December 16-24, 2024:

Overview

This week saw significant developments with the release of BETA 623, marking a major milestone despite known issues. The community welcomed XYplorer as a new VIP Gold supporter, demonstrating growing commercial interest in twinBASIC. Discussions centered around Windows compatibility, constructor implementations, and various technical implementation details.

Major Announcements

  • Wayne Phillips released BETA 623 with significant changes but noted several known issues
  • XYplorer (advanced file manager) joined as a VIP Gold supporter, planning migration from VB6 to twinBASIC
  • Confirmation that Windows XP compatibility will be maintained in future releases

Technical Implementations

  • Clarification on class constructor implementation using New events and [COMCreatable(False)] attribute
  • Discussion of LongPtr/LongLong type conversion behaviors and proper handling of 32/64-bit compatibility
  • Collection key case sensitivity behavior explained (default case-insensitive unless using vbBinaryCompare)

Development Progress

  • Wayne reported that PhotoDemon and Lems applications are now fully working in the latest build
  • Known limitations in BETA 623 include UserControl display issues and MDI form menu problems
  • Discussion of potential Windows 2000 support, with current focus remaining on Windows XP as minimum

Community Support

  • Growing discussion around funding additional developers, particularly for tBA development
  • Increased interest in industrial/legacy system support scenarios
  • Active community engagement in testing and reporting various implementation details

Conclusion

The week concluded with the significant BETA 623 release, though Wayne acknowledged it as an interim/experimental build with known issues. The addition of XYplorer as a VIP Gold supporter represents a major validation of twinBASIC's commercial viability. The community continues to show strong engagement in technical discussions and testing, while funding remains a key factor in accelerating development, particularly for features like tBA.

Around the Web

XYplorer Now a Gold Sponsor of twinBASIC

From Wayne in Discord:

Some of you may have already noticed the new VIP Gold logo on the twinBASIC website. We’re thrilled to announce that Don from XYplorer is our latest VIP Gold supporter! A huge thank-you goes to Don and the Cologne Code Company for supporting us.
For those unfamiliar, XYplorer is an advanced file manager written entirely in VB6. Don is now migrating and testing XYplorer with twinBASIC, demonstrating the power and potential of our platform. If you haven’t explored XYplorer yet, it’s well worth a look - it’s a fantastic example of what VB6 can achieve, with a crisp and modern interface despite the language being abandoned for over 20 years. Check it out at https://www.xyplorer.com/
XYplorer - File Manager for Windows
XYplorer is a file manager and explorer replacement for Windows. Fast, powerful, portable, dual paned, and multi-tabbed. License from $14.95.

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.5-Sonnet, sorted in order of its opinion of "most impactful changes."

twinBASIC BETA 623 represents one of the most significant updates to date, with major architectural changes to the form designer and substantial improvements to VB6 compatibility.

The centerpiece of this release is the complete rework of the form designer to use live-backed forms instead of isolated control rendering, dramatically improving ActiveX control support and overall reliability. New project settings provide developers with greater control over code generation, executable optimization, and security features like ASLR, while extensive VB6 compatibility improvements include better control naming conventions, regional settings support, and corrected behavioral patterns. The compiler also received attention with refined diagnostics, improved type handling, and reduced output size across all codegen models.

While this experimental release comes with some known limitations regarding UserControls and MDI forms, it marks a crucial step toward production-ready status by delivering both modern development features and enhanced VB6 compatibility.

  • Major IDE Form Designer Overhaul: Implemented live-backed form designers instead of isolated control rendering, improving ActiveX control support and fixing various designer-related issues

  • Enhanced Code Generation: Added new project settings for code optimization (size vs speed), with improved output size reduction across all models (5-20% smaller). New "Codegex Model" setting allows fine-tuning of generated code.

  • Security Enhancement: Added optional ASLR support (Address Space Layout Randomization) - a security feature that randomly positions program memory locations to help prevent certain types of memory exploitation attacks.

  • New Project Settings:

    • 'Codegen Model' for optimizing generated code (size vs speed tradeoffs)
    • 'Include Runtime PNG Support' to optionally reduce executable size
    • 'Strip PE File Relocation Symbols' (default: YES for EXEs, NO for DLLs)
    • 'Enable Address Space Layout Randomization (ASLR)' (default: YES)
    • 'PE File Image Base Address' for custom EXE/DLL base address
    • 'Project: Debuggable' to control breakpoint/stepping support project-wide
    • 'Icon Form' for specifying the form icon used as EXE build icon
  • IDE Improvements:

    • Live-backed form designers replacing isolated control rendering
    • Added 'View as Markdown Preview' context menu option for .MD files
    • Better color picker positioning near window edges
    • Improved form designer mini-toolbar for ActiveX controls
    • IDE now remembers Win32/Win64 target architecture per project
  • VB6 Compatibility Improvements:

    • Controls now use 'ThunderRT6' prefix to match VB6
    • Implemented common base WNDPROC for all controls
    • Fixed String to numeric conversions to respect regional settings
    • Corrected Label.AutoSize behaviors
    • Fixed Form.MinButton/MaxButton with vbFixedSingle BorderStyle
    • Proper implementation of UserControl.ParentControls
    • Improved IVBGetControl implementation
    • Fixed TypeName() behavior for UserControls
  • Bug Fixes:

    • Resolved array handling issues in UDTs
    • Fixed HRESULT handling from type libraries
    • Corrected FPU error handling edge cases
    • Fixed 'Memory is locked' error with For-Each loops
    • Addressed DLL loading issues on Windows 7/8
    • Improved handling of ByRef Variant parameters
  • Development Features:

    • Added [Debuggable(False)] attribute for controlling debug support
    • New GetDeclaredTypeProgId and GetDeclaredTypeClsid helper functions
    • Improved diagnostic messages and error handling
    • Better support for ActiveX control initialization
  • Compiler Diagnostics Changes:

    • Warning TB0015 (DLL redirection) downgraded to HINT level
    • Added error TB5246 'Bad JSON Syntax' for corrupt/unparseable designer JSON
    • Added error TB5247 for missing form designer JSON files
    • Improved 'block not closed' error handling to better support auto-correction
  • Sample Project Updates:

    • Sample 4: Modified to work with CommandBars("Add-ins") menu across all user locales
    • Sample 4 and 5: Updated to use GetDeclaredTypeProgId instead of hardcoded strings
    • These changes demonstrate better localization support and modern programming practices

Note: This experimental release includes known issues with UserControls, MDI forms, Scale properties, and form designer memory management.


WARNING: The following issues are present in BETA builds 546 - 623 (the latest build as of publication):

  • there are known memory leaks in these versions, so memory usage will be higher than normal

twinBASIC BETA 623

  • IMPORTANT: This is an interim/experimental release. It includes significant changes, so some instability is to be expected.
  • 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.
  • 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)
  • fixed: IDE evaluating custom class enumerator (NewEnum) for Locals/Watches panel during debugging could cause recursion problems
  • improved: many form/UserControl/ActiveX behaviours reworked to better match VBx
  • fixed: accessing array element of fixed-length array inside a UDT with bounds-checks OFF would ignore the lower bound index [ https://github.com/twinbasic/twinbasic/issues/1920 ]
  • added: project setting 'Codegen Model' for refining the generated code (size vs speed)
  • improved: codegen output size reduced (in all models) from previous builds ('Smaller' model ~20%, 'Balanced' ~10%, 'Faster' ~5%)
  • fixed: not all ByVal params should be copied in the implicit function prolog [ fafalone, discord ]
  • fixed: (regression) LLVM compilation not working on Sub routines
  • added: project setting 'Include Runtime PNG Support' (default YES), set to NO to reduce final built executable size
  • added: project setting 'Project: Strip PE File Relocation Symbols' (default YES for EXEs, NO for DLLs)
  • added: project setting 'Project: Enable Address Space Layout Randomization (ASLR)' (default YES)
  • added: project setting 'Project: PE File Image Base Address', allowing to override the EXE/DLL image base address
  • fixed: 'Trace procedure entry and exit points' project setting could cause floating point return values of standard module procedures to be set to zero on Win64 target
  • fixed: DIAGNOSTICS panel now hides the file (group) nodes when all of its children are hidden
  • improved: added IDE option 'Check referenced packages are up-to-date' default YES [ Krool, discord ]
  • improved: the IDE will now remember the Win32/Win64 target architecture for a project and restore the last used architecture when loading the project
  • fixed: some issues in importing some VBP projects, causing 'circular reference' compilation errors after import
  • added: error TB5246 'Bad JSON Syntax' for when a designer underlying JSON is not parsable (e.g. corruption or bad import)
  • added: error TB5247 'Unable to find matching form designer JSON' for when a class form designer is missing or wasn't parsed (rather than generic 'circular reference' error)
  • added: 'View as Markdown Preview' context menu option for .MD files in the IDE
  • improved: (VBP import) IMPORT_LOG is now a markdown file with better formatting
  • fixed: 'block not closed' compilation errors could sometimes prevent auto-correction of other lines, such as 'EndIf' -> 'End If' [ wqweto, discord ]
  • fixed: 'Ctl' suffix is now added appropriately to AX Control type library symbol names when LIBFLAG_FCONTROL is not set and 'Use ActiveX Controls' flag is set in project references
  • fixed: delegate defined as 'Sub' would cause a crash if you try to use the (void) value as part of an expression [ loquat, discord ]
  • fixed: if the icon of a built executable has changed, Windows should now update the icon cache immediately
  • added: project setting for 'Icon Form' to match VBx support for specifying the form icon to use as the EXE build icon
  • fixed: passing a LongPtr value to a function delegate parameter would cause a compilation error rather than a warning [ fafalone, discord ]
  • improved: runtime controls now use 'ThunderRT6' class prefix rather than 'Thunder' (e.g. ThunderRT6CommandButton) to match VBx
  • improved: now using a common base WNDPROC for all controls to match VBx
  • improved: position of IDE color picker when near the bottom edge of the IDE window [ sokinkeso, discord ]
  • improved: IDE form designer mini-toolbar now available for AX controls to allow opening of property sheets
  • fixed: (regression) clicking anywhere in the monaco editor whilst using the 'View As JSON' feature caused an IDE Internal Error
  • fixed: String to numeric type conversions could sometimes ignore regional settings, not matching VBx behaviour [ kimpos, email ]
  • improved: form-designer has been reworked to use live backed form designers, rather than isolated control rendering [ fixes lots of AX controls like SSTab ]
  • fixed: Controls.Add now works with AX controls
  • fixed: DragIcon property sheet ellipses button now opens the Icon file browser, rather than generic picture file browser
  • improved: single-click inside a selected CheckBox/CheckMark/OptionButton in the form designer will now toggle the Value of the control
  • improved: VisualStyles control properties are now updatable at runtime
  • fixed: changing PictureBox.Appearance property at runtime would have no effect
  • fixed: setting property ProgressBar.Step would be ineffective (Native Common Controls)
  • fixed: some general issues with Label.AutoSize behaviours not perfectly matching VBx
  • fixed: Form.MinButton / MaxButton property ignored when Form.BorderStyle is vbFixedSingle [ VanGoghGaming, discord ]
  • added: [Debuggable(False)] attribute, defaults to True, allowing to turn off breakpoints/stepping support for a procedure or all procedures in a module/class
  • added: project setting 'Project: Debuggable', defaults to YES, allowing to turn off breakpoints/stepping for the whole project/package
  • improved: built-in packages now have the Debuggable setting set to NO to allow for easier step debugging in user projects
  • improved: some ActiveX control initialization errors are more gracefully handled by the form designer
  • fixed: issue with UDT return types being exposed in generated type-libraries [ VanGoghGaming, discord ]
  • fixed: issue with UDT containing other sub UDT members being exposed in generated type-libraries [ VanGoghGaming, discord ]
  • fixed: loading of form wit MDIClient property set to True could cause hard crash if there is no MDI Form in the project, rather than a trappable error
  • fixed: Err.Raise 0 should produce an invalid procedure call error, rather than a 'success' error message
  • fixed: changing breakpoints would not cause the project to be marked as dirty, so a further document edit was required to persist them [ Aaraya, vbforums ]
  • fixed: 'Use ActiveX Controls' property on COM references is now completely overriden (to FALSE) for MSAccess references which wrongly has FCONTROL flags set
  • improved: Sample 4 so that refering to CommandBars("Add-ins") menu now works regardless of user locale
  • added: [_HiddenModule].GetDeclaredTypeProgId(Of T) generic function for obtaining the stringified progID of a type
  • improved: Sample 4 and 5 to use GetDeclaredTypeProgId instead of a hardcoded string
  • fixed: IsMissing() returning False incorrectly when passed an empty ParamArray [ VanGoghGaming, discord ]
  • improved: added IDE setting 'Code Editor Font: Use Ligatures' (default FALSE) needed for some fonts [ Flowesans, discord ]
  • fixed: setting Timer.Interval to a negative value did not produce an error [ Krool, discord ]
  • fixed: linker bug causing 'Unable to load DLL' errors at DLL callsites on Win7/8 machines... sometimes [ HackerVlad, vbforums ]
  • fixed: some edge cases around ByRef Variant handling with regards to pass-thru arrays [ https://github.com/twinbasic/twinbasic/issues/1961 ]
  • fixed: hovering over a single-character operator in the code editor whilst in a debug session would throw an IDE error
  • fixed: some cases where code semantic highlighting doesnt work whilst in a debug session
  • fixed: hovering over symbols in the IDE whilst in a debug session could lead to "WARNING: execution delayed; ..." message in the DEBUG CONSOLE, followed by a freeze requiring compiler restart
  • fixed: TypeName() on a UserControl would return "ActiveXControlExtender", not the underlying unwrapped control type name
  • fixed: UserControl.ParentControls is now implemented (inc support for vbExtender/vbNoExtender)
  • fixed: rewrote IVBGetControl implementation to better match VBx and fix several issues
  • improved: IPerPropertyBrowsing based properties are now populated live on-demand when a field combobox is dropped in the IDE property sheet
  • fixed: setting MousePointer property at runtime could cause mouse pointer to be updated even when the mouse is in non-client window areas
  • fixed: Err.Raise without setting an explicit description would sometimes not set the correct implicit description
  • fixed: 'Memory is locked' error when using For-Each on a temporary array e.g. from Array() call [ https://github.com/twinbasic/twinbasic/issues/1936 ]
  • fixed: support for HRESULTs used as ordinary datatype from typelibraries [ https://github.com/twinbasic/twinbasic/issues/1937 ]
  • fixed: some edge cases around FPU handling of errors [ https://github.com/twinbasic/twinbasic/issues/1932 ]
  • improved: warning TB0015 (DLL redirection) has been downgraded to a HINT level diagnostic by default
  • fixed: (regression since BETA 593) 'Element not found' error when creating tB AX user control from hosts such as VBA UserForms
  • changed: DPI-awareness setting is now OFF by default when importing VBPs
  • improved: selecting multiple controls in the form designer was slow to respond
  • added: [_HiddenModule].GetDeclaredTypeClsid(Of T) generic function for obtaining the stringified CLSID of a COM type

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