twinBASIC Update: March 24, 2024

Highlights include the return of support for twinBASIC IDE Add-ins, global search in the IDE, two new projects from fafalone, and an eye-opening twinBASIC poll.

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


Highlights

With the release of BETA 474, support for twinBASIC IDE add-ins has been re-enabled (it was previously disabled as part of the major feature release in BETA 424).

In addition, the Global Search add-in is now included by default with twinBASIC.

Also, sokinkeso's auto-save add-in has been tested and updated for use with BETA 477.  See details below in the "Around the Web" section.

Discord Chat Summary

* Auto-generated via Claude-2-100k on poe.com

Here is a summary of the key points from the General channel transcript:

Introduction

The transcript covers general discussion about recent development progress on the new programming language twinBASIC. Conversations focused on new features, bug fixes, future plans, and comparisons to other languages.

Summary

  • Implemented a new RedirectToStaticImplementation attribute to redirect interface method calls to static functions, enabling interface implementations without pulling in full class code.

  • Discussed adding OffsetOf syntax like C to get offsets into vtables and UDTs.

  • Edit and continue will be enabled in v1.0, allowing code to be recompiled seamlessly during debugging.

  • Inline non-variant array initialization was requested, similar to C style arrays.

  • Unicode and ANSI string issues in VB6 were discussed, and how DeclareWide avoids problems in twinBASIC.

  • Interest in adding inline assembly support in the future.

  • Windows 10 regressions were lamented, with Windows 7 still preferred by many.

  • Expectations that twinBASIC will fill the niche for an easy and powerful language like VB6.

Conclusion

Good progress continues on delivering new twinBASIC features and fixing bugs. Comparisons to VB6 show twinBASIC's goal of providing a modern successor. Community excitement is building for the v1.0 release to bring twinBASIC out of beta.


Here is a summary of the key points from the Docs channel transcript:

Introduction

The transcript covers discussions related to documentation efforts for the new programming language twinBASIC.

Summary

  • A new wiki article was added covering the Anchors control property for automatic resizing/repositioning.

  • Discussed adding minimum size constraints on controls to prevent them disappearing when anchored.

  • Scrollbars option was suggested to automatically add scrollbars when content overflows.

  • New built-in functions were added to the docs: PictureToByteArray, CreateGUID, GetMem/PutMem, AllocMem, FreeMem, Int3Breakpoint.

  • Int3Breakpoint explained as useful for native debugging to break exactly on the raw breakpoint instruction.

  • Dock property was noted as missing from the features list and needing documentation.

  • Bugs were reported with vbDockFill not respecting other docked controls.

Conclusion

The wiki documentation continues improving with new articles and built-in function documentation. Community contributions and discussion helps drive documentation priorities and content. Work remains to fully document major new language features.

Around the Web

INamespaceTreeControl Wrapper Control

From fafalone's announcement in Discord's show-and-tell channel:

This control is a fairly complete wrapper for INamespaceTreeControl2. It implements options for all the flags, raises events for common events, implements IShellItemFilter to allow showing files (and filtering which ones) and showing hidden/superhidden items. It supports checkboxes, which were very difficult to implement, because the documentation is incorrect and the .GetNextItem method can only ever search siblings without moving to request the child. So the tree had to be recursively walked. There's a number of other little features throughout the control.

The project is available on GitHub:

GitHub - fafalone/ucExplorerTree: ActiveX Control Wrapper for INamespaceTreeControl
ActiveX Control Wrapper for INamespaceTreeControl. Contribute to fafalone/ucExplorerTree development by creating an account on GitHub.

twinBASIC Control Panel Applet Demo

In this project, fafalone demonstrates how to create a mini application (i.e., an applet) that appears in the Windows classic Control Panel (still available and working in Win 10 and Win 11):

GitHub - fafalone/TBControlPanel: twinBASIC Control Panel Applet Demo
twinBASIC Control Panel Applet Demo. Contribute to fafalone/TBControlPanel development by creating an account on GitHub.

Here's his announcement text from Discord:

This project uses twinBASIC's Standard DLL capability to create a .cpl file exporting CPlApplet, the method for classic control panel applets, still recognized in both Win10 and Win11.

In addition to showing how to go from the property sheet demo project to a control panel applet, this project demonstrates two important techniques: How to load resources from a DLL from within the DLL itself, and how to use ComCtl6 styles/controls/functions within a DLL when the host exe doesn't provide a manifest, using the CreateActCtx and ActivateActCtx APIs. That's also how it's done per control-- activate it, all windows created use that instead of the process default context until deactivated again.

And what happens if you double-click that "TBCplApplet" icon in the screenshot above?  Presumably, you will see the following dialog:

Per fafalone:

The original property sheet demo project, to refresh your memory: https://github.com/fafalone/PropsheetDemo
GitHub - fafalone/PropsheetDemo: twinBASIC Property Sheet Demo
twinBASIC Property Sheet Demo. Contribute to fafalone/PropsheetDemo development by creating an account on GitHub.

Auto-Save Addin Working Again

When Wayne introduced a major update to the twinBASIC IDE in BETA 424, custom add-ins were temporarily disabled.  Add-in support was re-introduced in BETA 474 this week.

Less than a week later, sokinkeso had his twinBASIC IDE Auto-Save plugin tested and working in the revamped IDE.  Here's sokinkeso's announcement in Discord:

Finally I found time to create a github account, so this first release of AutoSave addin is in there. With some fixes, and with the Project settings implemented. This is v2.2.23 , for x32 and x64 and has been tested on twinBasic BETA 477.

The project, along with installation instructions, is available on GitHub:

Not Feeling the Love

So, Wayne posted a poll in the twinBASIC Discord chat server this week with a simple question for the twinBASIC Community:

What are you most looking forward to?

  • MDI forms
  • PropertyPages
  • fafalone's next show and tell
  • Mike's DevCon presentation
  • RADBasic
  • something else

Now, there is no shame in losing to fafalone's work in a poll such as this.  Or to much-anticipated twinBASIC features like Multiple-Document Interface (MDI) forms and PropertyPages.

But when you come in last behind ... [checks notes] ... RADBasic!!! in a poll of the twinBASIC community, it makes you really start to wonder about your life choices:

At the risk of further humiliation, let me take this opportunity to remind you that I will be giving my annual twinBASIC presentation at the upcoming Access DevCon Vienna conference on April 18 and 19, 2024.  For details and registration info, see below.  Unless, you know, you're looking forward more to "something else."

twinBASIC at Access DevCon Vienna 2024
Join me at Access DevCon Vienna 2024 for my presentation on creating MZ-Tools-style VBIDE addins using 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.

ChatGPT Changelog Summary

* Auto-generated via ChatGPT, sorted in order of ChatGPT's opinion of "most impactful changes."

  • improved: Enabled experimental add-ins feature again, including the global search add-in by default.
  • fixed: Resolved issues affecting the IDE's user interface, such as docked panels losing resizability, keyboard input problems, and menu editor focus loss.
  • fixed: Corrected errors in the floating-point unit (FPU) constant folding and addressed ListBox methods that incorrectly triggered refresh actions.
  • fixed: Eliminated bugs in data binding functions and UserControl_Terminate event firing multiple times.
  • added: Implemented missing declarations for [_HiddenModule].vbaRefVarAry and [_HiddenModule].vbaAryMove.
  • fixed: Fixed a regression issue with the docking feature and ensured the Host.CurrentProject.Save function works correctly for add-ins.

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

BETA 473

  • fixed: changing a floating panel to be docked loses resizability until IDE is restarted [ VykosX, discord ]
  • fixed: code editing home key behaviour [ wqweto, discord ]
  • fixed: constant folding bug with some FPU errors still being triggered when [FloatingPointErrorChecks(False)] is used [ wqweto, discord ]
  • fixed: keyboard entry into other panels (e.g. property sheet) was not correct when a menu item was selected in a form designer [ feldharke, discord ]
  • fixed: pressing {+} button in menu editor was losing focus of the menu editor
  • fixed: moving mouse cursor outside of the form designer area would trigger the toolbox control selection to reset [ fafalone, discord ]
  • fixed: internal GetLiveValue/SetLiveValue/GetParent data binding abstractions were leaking through as real control events [ fafalone, discord ]
  • fixed: ListBox.AddItem/Remove no longer call ListBox.Refresh internally [ sokinkeso, discord ]
  • fixed: ListBox scrolling issues when contained > 65535 items [ woeoio, discord ]

BETA 474

  • improved: (experimental) ADDINS are now enabled again (keyboard bindings currently disabled)
  • improved: (experimental) GLOBAL SEARCH addin is now included by default

BETA 475

  • fixed: addin panels left/right resizer bars were not working [ fafalone, discord ]
  • fixed: changing panel layout causes some addin functionality to fail [ VykosX, discord ]

BETA 476

  • fixed: UserControl_Terminate event could fire more than once in some hosts

BETA 477

  • fixed: (regression) some issues with the Dock (docking) feature of WinNativeForms
  • added: missing decleration of [_HiddenModule].vbaRefVarAry [ fafalone, discord ]
  • added: missing decleration of [_HiddenModule].vbaAryMove [ fafalone, discord ]
  • fixed: (addins) Host.CurrentProject.Save was silently failing [ sokinkeso, discord ]

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