twinBASIC Update: August 25, 2025

Highlights include an intriguing announcement from Wayne Phillips, a Windows Toast Notification demo, and sample TBMAN code for INI file I/O and HTTP support.

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

Next Scheduled Release - August 29, 2025

As Wayne announced on August 14, the next twinBASIC BETA version will be released on August 29.

This is unusual for two reasons:

  1. Wayne's typical release cadence for twinBASIC is 2-5 new versions per week
  2. He rarely announces a release targeted at a specific date

This makes me wonder what exactly Wayne has in store for us this Friday...

Discord Chat Summary

* Auto-generated via Claude-Sonnet-4

Overview

This week's twinBASIC Discord activity focused heavily on practical implementation challenges and compatibility features. The community engaged in detailed discussions about DirectX integration, delegate functionality for call-by-pointer operations, and form designer improvements. Several new members joined, indicating continued growth in the twinBASIC community.

DirectX and Graphics Integration

  • fafalone clarified that WinDevLib provides twinBASIC-compatible definitions of the underlying DirectX C API rather than recreating the VB6 dx7vb.dll wrapper functions
  • DirectDraw is fully covered in WinDevLib, though Direct3D 7/8 support is limited to what's needed for DirectShow
  • The original dx7vb.dll and dx8vb.dll should work as-is with twinBASIC, though fafalone noted testing challenges on modern systems
  • Community member alaskandruid explored options for DirectX migration and offered to fund wrapper development for specific use cases

Language Features and Bug Fixes

  • waynephillipsea identified a bug where generic function type parameters don't properly propagate when calling other generic functions, despite existing test coverage
  • Delegate types for call-by-pointer functionality were highlighted as a key twinBASIC feature, supporting both Function and Sub delegates with optional CDecl calling convention
  • VB6 Collection compatibility nuances were discussed, particularly around key handling (strings only) versus index access

IDE and Development Tools

  • Form designer DPI-related bugs were reported affecting precise control movement, particularly when controls are within containers like PictureBox
  • waynephillipsea identified that DPI awareness settings can cause fractional pixel movements and recommended temporarily disabling DPI awareness for precise positioning
  • Compiler restart issues continue to be a common workaround for various IDE problems

Community Projects and Examples

  • deletedewd updated a comprehensive Toast Notifications project demonstrating WinRT object interaction and AsyncOperations handling
  • The project serves as a practical example for both asynchronous callbacks and synchronous blocking with Await functionality

Conclusion

The week demonstrated twinBASIC's growing maturity in handling complex compatibility scenarios, from DirectX integration to advanced language features like delegates. While some IDE refinements are still needed, particularly around form designer precision, the core language functionality continues to expand with robust VB6 compatibility. The community's willingness to contribute examples and fund specific development needs shows strong engagement with the project's evolution toward v1 release.

Around the Web

Updated ToastNotification Demo

Over on VBForums, VanGoghGaming recently updated his ToastNotification demo project:

Just updated this project to cover the full functionality of Toast Notifications. The WinRT Interfaces package is linked (no longer embedded to save space in the project file) so you need to grab it from the package server first if you don't already have it.
Updated functionality includes:

• Creating a Start Menu link which allows you to assign custom events when clicking the notification buttons. It also allows users to enable/disable notifications for your app in Windows Settings -> System -> Notifications & actions.
• The COM Activator class for handling offline notifications (like when the user interacts with the notification at a later time after your app had been closed).
• The Downloader class (used here for downloading the notification image from the Internet instead of including it in the project). Downloading is done asynchronously and the class raises an event when completed.

VanGoghGaming mentioned the update in Discord, as well, with this additional side benefit:

It's also a good starting point to see how to create and interact with WinRT objects and handle their ubiquitous AsyncOperations (both asynchronously with callbacks and synchronously with a blocking Await).

TBMAN Package

I first wrote about woeoio's TBMAN project back in December of 2024:

twinBASIC Update: December 9, 2024
Highlights include a proof of concept Excel XLL add-in written in twinBASIC, the TBMAN toolkit twinPACK, and a successful port of the OrdoPdfReader OCX.

At the time, the key highlighted feature was its integration of Tim Hall's VBA-JSON project. However, in the past week, woeoio has posted two additional pieces of sample code using TBMAN to the Discord show-and-tell channel:

TBMAN: ini object

Sample code:

        'call by one line code
        MsgBox TBMAN.Ini.LoadFrom("C:\windows\VBAddin.INI").Section("Add-Ins32").Item("AmicForVB.Connect")
        'read and write demo
        With TBMAN.Ini.LoadFrom("C:\windows\VBAddin.INI")
            With .Section("Add-Ins32")
                .Item("RVBAddIn.Connector") = 4
                Debug.Print .Item("AmicForVB.Connect")
            End With
            'If the path of the function is omitted, it is saved to the source file 
            .SaveTo "d:\inew.ini"
        End With
        'create demo
        With New TBMANLIB.cIni
            With .Section("Test")
                .Item("abc") = 123
                .Item("name.hello") = "你好"
            End With
            With .Section("Test2")
                .Item("list") = 456
                .Item("age") = 39
            End With
            .SaveTo "d:\hello.ini"
        End With
    End Sub

TBMAN: http client object

Sample code:

    Const API_HOST  As String = "https://api.vb6.pro"
    Const API_TOKEN As String = "73qFpsvbjJuAZ7kEEyzNUOstoUOJ5XrJM7jB01okRlU="
    'all api list
    Const API_CHECKOUT_SESSIONS As String = API_HOST & "/v1/checkout/sessions"
    
    Private Sub Form_Load()
        With TBMAN.HttpClient
            'set headers
            .RequestHeaders.Item("Authorization") = "Bearer " & API_TOKEN
            'set query string, auto urlencode
            .RequestDataQuery.Item("id") = 123456
            .RequestDataQuery.Item("ver") = Now()
            'set form post body, auto urlencode
            .RequestDataBody.Item("username") = "woeoio"
            .RequestDataBody.Item("password") = "zxc123"
            'if body is json, like this
            ' Dim Data As String
            ' With New TBMANLIB.cJson
            '     .Item("account") = "dengwei"
            '     .Item("pwd") = "@$124$"
            '     Data =.Encode()
            ' End With
            ' MsgBox .Fetch(ReqPost, API_CHECKOUT_SESSIONS, Data).ReturnText()
            'now send request, and use response
            With .Fetch(ReqGet, API_CHECKOUT_SESSIONS).ReturnJson()
                Text1.Text = .Encode(, 2) 'convert json object to string
                If .Item("code") = 0 Then '0 is success
                    'now you can use data node, NOTE: Json array index base on 1, array object is Collction
                    Label1.Caption =.Item("data")(1)("prodname")
                Else
                    MsgBox(.Item("msg")) 'show error info if fail
                End If
            End With
        End With
    End Sub

As a reminder, the easiest way to incorporate this project into your own twinBASIC applications is via the twinBASIC Package Manager:

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.

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