twinBASIC Update: January 14, 2024

Highlights include a dedicated twinBASIC forum at VBForums, new teaser images from this Friday's upcoming beta release, and several projects from fafalone.

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

Weekly Teasers from Wayne

Here are some teaser images from the forthcoming release, tentatively scheduled to be released later this week on January 19.

Updated "New / Open Project..." Dialog UX

Project Settings/References Now a Modal Dialog

[Wayne]: Project Settings / References now moved to a modal dialog.  That was a leftover from the VSCode days where we couldn't create modal dialogs.

LIB/OBJ File Support

[Wayne]: Here's a closer look at the new LIB/OBJ file support coming in the next release.  The syntax is:  Import Library "filepath" As <Namespace> Link <DependenciesList>.  The symbol used for <Namespace> can then be used in Declare statements for the Lib argument, as pictured.

Keyboard Shortcut Customization

[Wayne]: for the next release, all general IDE actions now have command IDs associated with them, and with this we now have keyboard shortcut customization builtin so that you can assign any keyboard shortcut to any of these new command IDs.  Currently 205 commands are available.

[Editor's note]: For a full list of available command IDs, refer to Discord:

On a related note, executing the command IDs will also be exposed via the extensibility model meaning that twinBASIC IDE Add-ins will be able to call all IDE commands directly, too.

[Wayne]: This new command-based system is going to great going forward.   With this now in place, we've done 80% of the work for a macro-recorder.

Format Menu Unveiled

[Wayne]: Format menu now all implemented ready for the next release

New "Light" Theme

[Wayne]: Just tweaking the new 'light' theme:

twinBASIC Gets Its Own Forum on VBForums

After nearly three years, twinBASIC finally has a dedicated forum on the VB6 discussion site, VBForums.

As the original twinBASIC thread was over 1,750 replies and was nearing one million (!) views, it was well past the time for a dedicated forum:

Wayne announced the milestone in a thread in the new forum:


Hello! Warm greetings to all vbforums members,

I'm thrilled to see this significant milestone for the twinBASIC community. Thanks to the incredible support and dedication of the vbforums team, we now have our very own subforum here! This is not just a new space for discussions; it's a hub for innovation, learning, and collaboration.

First and foremost, a heartfelt thank you to the vbforums team. Your belief in twinBASIC and commitment to providing a platform for our community is deeply appreciated. Your efforts have given twinBASIC enthusiasts a place to call home, and for that, I am genuinely grateful.

To everyone who's been part of our journey and those just joining us, welcome! twinBASIC is more than just a programming language; it's a testament to what we can achieve when we share a common passion for technology and creativity. Whether you're a seasoned programmer or just starting, this forum is for you. Dive into discussions, share your projects, ask questions, and help others. Your insights and experiences are what make this community vibrant and unique.

As we look ahead, there's a lot to be excited about. This year is packed with updates and new features for twinBASIC. While I don't want to give away too much too soon, I assure you there are plenty of reasons to stay tuned. We're committed to making twinBASIC more powerful, user-friendly, and versatile, and your feedback will be instrumental in this journey.

So, let's get started! Try out twinBASIC, engage in the forums, and be part of shaping the future of this incredible tool. Together, we'll continue to push the boundaries of what's possible.

Thank you for your enthusiasm and support. Here's to a fantastic journey ahead in the twinBASIC subforum!

Best regards,

Wayne Phillips

Discord Chat Summary

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

Here is a summary of the key points from the General channel Discord chat transcript about the development of twinBASIC over the past week:

Introduction

The General channel covers a wide range of topics related to the ongoing development of the new programming language twinBASIC, which aims to be a modern revival of the classic Visual Basic 6 language.

Key Highlights

  • A new release is planned for January 19th, which will include many anticipated features like static library linkage support, IDE keyboard shortcuts, and more. There is much excitement building in the community.

  • Work continues on implementing a full-featured IDE, including improvements like a modal dialog for project references, a new formatting menu, and light/dark themes.

  • Discussion on the best practices for when and how much to promote twinBASIC publicly before the v1.0 release, balancing interest with setting proper expectations.

  • Conversations around potential new features like IDE localization, macro recording, git integration, and multithreading support.

  • Troubleshooting various bugs and limitations raised by users trying out twinBASIC on their projects.

Conclusion

The conversations show progress towards the goal of a v1.0 release in 2024, including finishing up key IDE functionality and language features. Community interest and engagement continues to grow steadily as twinBASIC becomes more capable. There is still much anticipation for the upcoming January release and subsequent progress towards version 1.0.

Around the Web

tbShellLib is now WinDevLib

This is one of two major project releases from fafalone that I completely overlooked in earlier weekly updates (sorry Jon!).  On the bright side, there was an important recent bug fix that is now included for anyone checking out the project for the first time.

Here's an AI-generated summary of the project:


Introducing WinDevLib: A Leap Forward in twinBASIC Development

WinDevLib, formerly known as tbShellLib, is an expansive Windows Development Library tailored for twinBASIC. It represents a significant evolution beyond its initial scope, which primarily focused on shell programming. The library now offers a comprehensive Windows API experience analogous to using windows.h in C++, marking a transition that is more in line with its broader ambition of providing a general Windows development toolkit.

What's New?

  • Renaming: Reflecting its broader scope, tbShellLib has been rebranded to WinDevLib, with corresponding updates to compiler constants and module names—for instance, tbShellLibImpl is now WinDevLibImpl.
  • Enhanced Intellisense: With twinBASIC's Beta version 368 and newer, Intellisense performance has been significantly improved, thanks to caching and other optimizations. This enhancement has made WinDevLib even more user-friendly and responsive.
  • Current Version: The library is continuously updated, with the latest release being version 7.2.301 as of January 10th, 2024.

About the Project

Created by Jon Johnson (fafalone), WinDevLib is a direct successor to oleexp.tlb and the Modern Shell Interfaces Type Library project for VB6. It is fully compatible with x64 systems, overcoming the limitations of midl-generated 64-bit type libraries. This project serves twinBASIC, VB6, and VBA communities by providing access to Windows shell and component interfaces using twinBASIC-friendly types, addressing issues with unsigned types, C-style arrays, and double pointers commonly found in other imported references.

Library Features

  • COM Interface Coverage: WinDevLib includes over 2,200 common COM interfaces, ensuring compatibility and ease of use for developers accustomed to working with COM in other languages.
  • Windows API Integration: The library now includes around 5,500 hand-reviewed Windows APIs, restored for 64-bit compatibility and curated to avoid errors found in automated conversion tools.
  • Enums and Intellisense: By converting constant groups into Enums, WinDevLib leverages twinBASIC's advanced Intellisense capabilities, which now support more types in API definitions.
  • Native twinBASIC Implementation: As a twinPACKAGE, WinDevLib benefits from twinBASIC's native support for interfaces and coclasses, allowing for a seamless integration of definitions and regular code within the same project.

Why Use WinDevLib?

WinDevLib simplifies the development process by eliminating the need to define interfaces and their dependencies manually. It is designed to be a drop-in solution, substantially reducing setup time and effort for new projects. With its extensive API coverage, it aims to fulfill about 99% of core system DLL requirements, making it an indispensable tool for twinBASIC developers.

Conclusion

WinDevLib is an essential addition to any twinBASIC developer's toolkit, offering a rich set of features and improvements that streamline the development process. Its transition from tbShellLib to WinDevLib reflects its growth and the commitment to providing a robust and comprehensive development library for twinBASIC programmers.

For more information and to contribute or utilize this evolving library, developers are encouraged to visit the WinDevLib project page on GitHub.

(c) 2022-2023 Jon Johnson (fafalone)


DevExplorer: A twinBASIC Clone of the Windows Device Manager

The second big recent project release from fafalone was his Windows Device Manager clone, DevExplorer:

What started out as a proof of concept morphed into a full blown replacement.  

In the course of implementation, fafalone stumbled upon an important reason to use twinBASIC rather than VB6 for this project:

There's an unusual, for now, reason to do this project in twinBASIC: The enable/disable/remove APIs (at a minimum) do not allow 32bit applications to call them on 64bit Windows-- the SetupDiCallClassInstaller API will fail with ERROR_IN_WOW64, as documented on MSDN. Additionally, there's a 'Resources' tab in the properties [that] will not load under WOW64. I haven't thoroughly tested the rest of the functionality on WOW64, but the bottom line is you'd need extensive workarounds and hacks to accomplish the same tasks in VB6, because a large portion of hardware setup functionality has been disallowed under WOW64.

Here's an AI-generated synopsis of the project:


Synopsis of DevExplorer

DevExplorer is a full-fledged device management application, akin to the native Windows Device Manager, created using twinBASIC. Initially conceived to test device enable/disable functionalities, the project has since evolved into a comprehensive tool with a suite of features to manage system devices effectively.

Key Features

  • Device Management: Users can enable/disable, remove, uninstall, update drivers, or eject devices straight from the application.
  • Hidden Devices: It has the capability to list 'hidden devices' that are installed but not currently present in the system.
  • Problem Indicators: The application indicates devices with issues using an overlay icon, similar to the native Device Manager, and fetches problem descriptions from the system.
  • Device Properties: Double-clicking a device opens its properties, and a dedicated 'Resources' tab is included, which is not accessible under WOW64.
  • Update Driver Wizard: Simplifies the process of updating device drivers.
  • Administrative Privileges: Most features require running the app as an administrator, enabling it to perform a wide range of actions.

The project utilizes the WinDevLib package, previously outlined in this article, to bridge the gap between 32-bit and 64-bit environments. WinDevLib, also created by Jon Johnson (fafalone), provides the necessary Windows API functionality to ensure that DevExplorer can operate effectively across different architectures.

DevExplorer aims to offer a straightforward solution for device management, delivering a tool that can be easily integrated into developers' workflows. It inherits a comprehensive API set from WinDevLib, allowing it to interact with system devices and resources with the same level of depth and control one would expect from native Windows applications.

Incorporating the latest improvements in twinBASIC's Intellisense and leveraging the 64-bit compatibility of WinDevLib, DevExplorer is positioned as a practical tool for developers looking to manage devices on various versions of the Windows operating system. It stands as a functional showcase of twinBASIC's potential in updating and maintaining legacy software within modern computing infrastructures.


Using the Windows Imaging Component in twinBASIC

This is what I get for overlooking updates to the Show-and-Tell channel in the twinBASIC Discord and then going on vacation for a week.  Here is yet another new project from fafalone, this one a straight port of a VB6 demo of interacting with the Windows Imaging Component.

Here's the intro to the original VB6 demo via VBForums:

Intro
The Windows Imaging Component has been included in Windows since Vista, but there's been no easy way to use it from VB, not in the least due to many variable and pointer types that are incompatible. I've now converted these interfaces to work with VB and added them to my Modern Shell Interfaces type library (added in version 4.62, released 20 Oct 2019).

This project provides a basic introduction. You can load a file of type JPG, PNG, GIF, BMP, TIF, or ICO; then scale it (or not-- you can skip the scaling and just save it as a new format) and convert it to either PNG or JPG. JPG supports setting a percentage for image quality (it will appear in the Save As... dialog).

And here is the intro to the twinBASIC port via Discord:

Thought I'd see if my WIC demo worked in tB. Happy to report the initial import of the VB6 project worked flawlessly. From there I rewrote for 64bit. Thought it's worth noting how much easier WinDevLib API modules make this: Rather than go through and update all the Win API defs, all I did was comment them out, letting WinDevLib take over those in addition to taking over the COM interfaces from oleexp. After a minor hiccup (major bug in WinDevLib.IStream, now fixed), all that needed to be modified was removing some oleexp. qualifiers, switching GetObject to GetObjectW since the intrinsic version was getting priority, and changing handles/pointers to LongPtr.

Head over to the Discord show-and-tell channel to download the .twinproj file as well as a zip file with the original VB6 project and unmodified tB import.

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.

No new releases the past two weeks.

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