twinBASIC Update: May 20, 2024

Highlights include the long-awaited arrival of MDI forms, OS targeting, an animated GIF project, and the first commercially available project built with twinBASIC.

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

MDI Support Arrives

As announced by Wayne:

BETA 537 is out, with MDI support -- see sample 19.     When reporting bugs relating to MDI, it would be most helpful if you can post a minimal project based off Sample 19 to demonstrate the issue(s).

I wouldn't dive in trying to load complex MDI projects just yet until the dust settles
Sample 19. Demonstrating the new MDI feature in twinBASIC.

Discord Chat Summary

* Auto-generated via ChatGPT-4o-128k on poe.com

Weekly Update on twinBASIC Development

This week in the twinBASIC general channel, there were several discussions and updates regarding the development of the new programming language. Here are the key points from the past week:

  • Tabbed Interface and MDI Support:

    • Discussions about implementing a tabbed interface and detachable/movable windows for output in the twinBASIC IDE were prominent. While a user control simulating a tabbed control exists, it requires additional extender properties to be fully functional.
    • WaynePhillipsEA announced that MDI (Multiple Document Interface) support is coming this week, with the initial release being 95% complete.
  • Database System Support:

    • There were suggestions to support ACE and SQL Server as a starting point for a decent database system in twinBASIC. Additionally, the importance of supporting low-cost databases like MariaDB, which are commonly offered by remote providers, was highlighted.
  • Build Output Path and Command Line Compilation:

    • Users discussed changing the build output path to use system variables like %USER%, with a workaround provided using a [RunAfterBuild] function.
    • Command line compilation is not yet available but is planned for version 1.0, expected in the coming months.
  • MDI Forms Events in VB6:

    • WaynePhillipsEA noted issues with MDI Forms' Activate/Deactivate events in VB6, which only fire when switching between forms within the same process. This behavior is also being incorrectly handled in twinBASIC.
  • Custom Form Types:

    • Currently, twinBASIC does not support creating custom form types. However, users can reuse form designs with multiple form classes by using the FormDesignerId attribute.
  • ActiveX Control Milestone:

    • The iGrid control from 10tec is now available as the first commercial ActiveX control built with twinBASIC, offering full 32-bit and 64-bit support. This milestone showcases twinBASIC's potential for supporting legacy VB6 projects.
  • Compilation and Debugging Issues:

    • Users reported issues with the IDE process interfering with console applications and causing crashes when using certain command switches.
    • There were also discussions about errors and warnings during project imports from VB6, with suggestions to use safe mode to pause the compiler during code changes.
  • Reporting and Document Printing:

    • Questions were raised about the roadmap for reporting and document printing features in twinBASIC, similar to VB's Data Reports and ActiveX Designers. The community is looking forward to solutions for outputting to PDF/HTML and custom print/preview solutions.
  • Bug Reports and Minimal Examples:

    • WaynePhillipsEA emphasized the importance of providing minimal projects based on Sample 19 when reporting bugs related to MDI support to facilitate easier debugging and fixes.

Conclusion

This week saw significant progress in the development of twinBASIC, particularly with the upcoming MDI support and the milestone achievement of the iGrid control. Discussions also highlighted the community's interest in database support, custom form types, and reporting features. As twinBASIC continues to evolve, community feedback and collaboration remain crucial in shaping its future capabilities.

Around the Web

First Commercially Available Product Built with twinBASIC

Here's Wayne's announcement in Discord:

Some of you have already noticed this.  To the best of my knowledge, this is the first commercial ActiveX control that is available, being built with twinBASIC, offering full 32-bit and 64-bit support:  the popular iGrid control from 10tec:  https://10tec.com/articles/64-bit-ocx-grid.aspx

Igor has worked hard to get iGrid upgraded from VB6 to support 64-bit in twinBASIC.  Congratulations to him on achieving such a milestone for his product.

Here's the announcement from the Latest Product News section at 10tec.com:

Today we have very good news for all iGrid ActiveX users: we have released the long-awaited 64-bit version of our ActiveX control. This was made possible by twinBASIC, a new development environment providing backward compatibility with existing VB6/VBA projects and offering significant improvements over the VB6 IDE. A year of hard work is behind us, and now we can provide a new modern edition of our grid control for real 64-bit development in such environments as Microsoft Office and twinBASIC.

Here's an excerpt from the product page at 10tec.com:

The VB6 source code of iGrid was converted to the twinBASIC project format and adapted to support both the 32-bit and 64-bit CPU architectures. We needed to convert and test declarations and calls for more than 200 Windows API functions and COM interfaces, and this work has been successfully done. twinBASIC with constant support of Wayne Phillips, the developer of this IDE, allowed us to compile the new version of iGrid for 32 and 64 bits!

Animated GIF Control for VBA

From fafalone:

IShellImageData makes showing animated gifs in VB6 and tB very easy, but it's a pain in 64bit VBA, where my oleexp isn't available for the interfaces, making a 64bit typelib with midl is painful, and UserForms don't expose a traditional hwnd/hDC automatically. And there's no timer, which this simple method needs.

So when someone asked for help with their method of showing animated gifs on UserForms -- using the ancient WebBrowser control which was breaking certain spreadsheet features-- I saw an opportunity to show off what tB could do for VBA and whipped up a quick wrapper over IShellImageData as an ActiveX control.

Just basic features in this initial release; set file at design or run time, Autoplay for the former, Play/Pause/Stop, SizeToFit, and BackColor options.  

But it worked in 64bit Excel on the very first try, love how far tB has come with UCs!
GitHub - fafalone/ucAniGif: Animated GIF ActiveX Control
Animated GIF ActiveX Control. Contribute to fafalone/ucAniGif development by creating an account on GitHub.

Extended Printer ComboBox Control

From fafalone:

Beta 2 of my ucPrinterComboEx control is now available. It uses a ListView in tile view mode to replace the default dropdown (though the standard mode with that is available as an option).

ucPrinterComboEx is a simple control to select a printer, using a ListView to substitute for a normal dropdown to display the large icon/2-line display that manyu other selection dialogs use. There's a selection change event, methods for accessing the full collection, and some additional information like the 'Model' field from the Printers folder available, as well as showing the default printer in bold text. Krool's IPAO techniques are used to provide basic keyboard support. The dropdown behaves like a real combobox, including the slide animation (if enabled for regular combo controls), sliding up instead if there's not enough room on the bottom, extending beyond the form if needed, and fine control over sizing options.

Project is available as a VB6 UserControl and twinBASIC version. These versions are slightly different; the VB6 version has a set of 32bit-only declares that are picked up in twinBASIC by my WinDevLib project. Some changes in qualifying types are made to support using oleexp and OLEGuids in VB6 as well. But the codebase is 99% the same.
GitHub - fafalone/ucPrinterComboEx: Extended printer combobox control
Extended printer combobox control. Contribute to fafalone/ucPrinterComboEx development by creating an account on GitHub.

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."

Here's a concise summary of the notable updates in twinBASIC:

  • Added MDI Forms Support: Full support for Multiple Document Interface (MDI) forms, including a sample project (Sample 19) to demonstrate this feature.
  • Project Target OS Version: New project setting allows targeting executables for specific OS versions, enabling better control over compatibility and feature usage.
  • Enhanced Control on MDI Forms: Unlike VB6, twinBASIC allows any controls on MDI forms, with optional docking. Controls that are not docked will appear on top of MDI child forms.
  • StartupPosition Support for MDI Child Forms: The StartUpPosition property is supported, with default values being imported from VB6 projects.
  • Opacity and TransparencyKey for MDI Child Windows: These properties are usable if the target OS is set to version 6.0 or higher, enhancing the visual capabilities of the MDI child windows.

These updates significantly enhance the functionality and compatibility of twinBASIC, further bridging the gap between classic VB6/VBA environments and modern programming needs.


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

BETA 537

  • added: support for MDI forms!
  • added: Sample 19. MDI Forms
  • added: project setting 'Project: Target OS Version' for targetting an executable for a particular OS version
  • NOTE: StartUpPosition is supported for MDI Child forms in twinBASIC (e.g. vbStartupOwner for center of the MDI Client area).  Default value on import from VBP is vbStartupWindowsDefault which is the equivalent enforced setting by VB6
  • NOTE: Unlike VB6, we allow any controls on the MDI form - docking is optional.  Undocked controls will appear on-top of MDI child forms.
  • NOTE: PictureBox.Align is supported for back-compat reasons, but is hidden with the newer general use Dock property being preferred
  • NOTE: Picture property is supported on MDI form, but will not currently display in the form designer
  • NOTE: the debug session currently always operates with target OS 5.1 (WinXP+)
  • NOTE: MDI child windows can use Opacity/TransparencyKey properties only if you specify target OS >= 6.0
  • NOTE: MDI child windows will always have a thick border regardless of BorderStyle property when target OS is >= 6.0
  • NOTE: there are currently no checks made to ensure you only have one MDI Form in the project.  This restriction will be added soon.
  • NOTE: there will definitely be issues around loading/showing/hiding MDI children in this release.
  • NOTE: known issue: the designated WindowList menu is not always up-to-date

BETA 538

  • fixed: (regression in BETA 537) a non-MDI Child form cannot be opened modally

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