> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# twinBASIC Update: November 6, 2022
- URL: https://nolongerset.com/twinbasic-update-november-6-2022/
- Published: 2022-11-07T03:12:49.000Z
- Updated: 2026-05-08T12:53:43.000Z
- Description: Highlights include native CoClass support and a TWINPACK package from fafalone with definitions for all the standard common controls.
- Author: Mike Wolfe
- Tags: twinBASIC Weekly Update, #Import 2026-05-20 02:59

*On April 23, 2021, I helped [Wayne Phillips](twitter.com/WaynePhillipsEA/) introduce the world to [twinBASIC](https://www.twinbasic.com/) at the [Access DevCon Vienna](https://www.donkarl.com/devcon/) conference. I [boldly predicted](https://nolongerset.com/devcon-2021/) 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](https://twitter.com/NoLongerSet) or email me at mike at nolongerset dot com.*

*Here are some links to get involved with the project:*

- **[Custom twinBASIC IDE Installation Guide](https://nolongerset.com/how-to-install-twinbasic/)* (NOTE: the twinBASIC VSCode extension is under a feature freeze until 2023)*
- *[GitHub Issue Tracker (report bugs)](https://github.com/WaynePhillipsEA/twinbasic/issues)*
- *[twinBASIC Discord Server](https://discord.com/invite/UaW9GgKKuE) ([chat about the project](https://github.com/WaynePhillipsEA/twinbasic/discussions/629))*
- *[twinBASIC/VBx LinkedIn Group](https://www.linkedin.com/groups/14132101/)*

---

## Highlights

### CoClass Support

For those of you interested in the advanced, low-level features of twinBASIC, direct support for CoClasses will be welcome news. Personally, most of this stuff is way over my head, so I'll simply [quote Wayne](https://github.com/twinbasic/lang-design/issues/52#issuecomment-1303647201) at length below:

---

The `CoClass` component type allows for the self-explanatory attributes of `[CoClassId("")]`, `[PredeclaredId]`, `[AppObject]`, ` [Restricted]` and ` [COMCreatable]`. The attributes `[Default]` and `[Source]` are allowed on the `Interface` entries. You must define one interface as `[Default]`:

```vba
[ CoClassId ("0BE35203-8F91-11CE-9DE3-00AA004BB851") ]
[ COMCreatable ]
CoClass StdFontCustom
    [ Default ] Interface stdole.Font
    [ Default, Source ] Interface stdole.FontEvents
    Interface stdole.IFont
End CoClass
```

In addition, and related to the [question from @bclothier](https://github.com/twinbasic/lang-design/issues/52#issuecomment-1265538725)–\["*wouldn't we need the option to provide a custom implementation of the `IClassFactory` / `IClassFactory2`?*"\]–there is another attribute of interest:

`[CoClassCustomConstructor("procName")]`

By default, the construction of `CoClass` types is done through COM via `CoCreateInstance` as you'd expect. If you want to override that behaviour, then you can provide the name of a custom constructor procedure here. We are now using this for the `VB.Global` class, as can be seen in WinNativeForms package:

```vba
[ CoClassId ("FCFB3D23-A0FA-1068-A738-08002B3371B5") ]
[ CoClassCustomConstructor ("[_HiddenModule].CreateGlobalObject") ]
[ AppObject ]
Public CoClass Global
    [ Default ] Interface VBGlobal
End CoClass
```

With the above definition, when the `Global` class needs to be instantiated, the procedure `[_HiddenModule].CreateGlobalObject` is called. This allows the compiler to provide the actual implementation of the coclass, rather than going through COM. I'm sure some of you will find uses for this feature. E.g:

```vba
[ CoClassId ("0BE35203-8F91-11CE-9DE3-00AA004BB851") ]
[ CoClassCustomConstructor ("COMStuff.CreateFontObject") ]
[ COMCreatable ]
CoClass StdFontCustom
    [ Default ] Interface stdole.Font
    [ Default, Source ] Interface stdole.FontEvents
    Interface stdole.IFont
End CoClass

Module COMStuff
    Public Function CreateFontObject(ByRef out As StdFont) As Long   ' HRESULT
        Debug.Print "StdFontCustom created..."
        Set out = New StdFont
        Const S_OK As Long = 0
        Return S_OK
    End Function
End Module
```

Forewarning: over time, the `CoClassCustomConstructor` attribute might change, e.g. into a `Sub New` inside the `CoClass` syntax. For the time being, this attribute is available in this form.

---

For those of you lost like me, Wayne provided a brief explanation of what CoClasses are in the [twinBASIC Discord Server](https://discordapp.com/channels/927638153546829845/927638154192748606/1038111377719570613):

> A `CoClass` can just be thought of as a regular class that you haven't implemented yourself.... it's one that is registered in the registry. The `CoClass` definition tells us the GUIDs (CLSID and IIDs) that tell the compiler how to instantiate the class via COM, and how to consume them.

### Global / App / Screen / Clipboard classes added to the WinNativeForms Package

Added as of [Beta 166](https://github.com/twinbasic/twinbasic/releases/tag/beta-x-0166).

### 

## Around the Web

### tbComCtlLib - Complete Common Controls definitions

[Posted by **fafalone** on vbforums.com](https://www.vbforums.com/showthread.php?898242-twinBASIC-tbComCtlLib-Complete-Common-Controls-definitions-x64-compatible):

> Almost all the work with API created Common Controls is from VB6 and only has x86 compatible definitions. But with twinBASIC being able to compile 64bit exes, it's time we had those definitions available in a x64 compatible form. I've gone ahead and done that. tbComCtlLib has all the standard common controls definitions, completed, with the major ones including additional undocumented definitions.   
>  
> This is supplied as a TWINPACK Package you can add to your project in Settings->References. It will work with tbShellLib-- which is needed if you wish to use the RichEdit OLE Extensions.  
>  
> This project is [also on GitHub](https://github.com/fafalone/tbComCtlLib).

The package files are [available for download](https://www.vbforums.com/showthread.php?898242-twinBASIC-tbComCtlLib-Complete-Common-Controls-definitions-x64-compatible) at vbforums.com.

![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2022/11/image-9.png)

### 

## Changelog

Here are the updates from the past week. You can also find this information by visiting the GitHub [twinBASIC Releases page](https://github.com/WaynePhillipsEA/twinbasic/releases).

[Releases · WaynePhillipsEA/twinbasicContribute to WaynePhillipsEA/twinbasic development by creating an account on GitHub.![](https://github.githubassets.com/favicons/favicon.svg)GitHubWaynePhillipsEA![](https://opengraph.githubassets.com/13bf5f13278e5633e644e312c6a75cfe0baf97f01dd45660573b36f5de0ee945/WaynePhillipsEA/twinbasic)](https://github.com/WaynePhillipsEA/twinbasic/releases)

### BETA 164

- added: compiler warning TB0010: `Duplicate DLL declaration detected`
- fixed: (regression) custom controls (WaynesButton etc) not working fully on Win32 architecture since BETA 153 due to UDT alignment changes
- fixed: WM\_UPDATEUISTATE sent to child HWND rather than the form HWND \[ Krool, discord \]

### BETA 165

- fixed: compiler crash when editing code \[ https://github.com/[/issues/1322](https://github.com/twinbasic/twinbasic/issues/1322) \]

### BETA 166

- added CoClass support \[ https://github.com/[twinbasic/lang-design/issues/52](https://github.com/twinbasic/lang-design/issues/52) \]
- added attribute `[CoClassCustomConstructor("procName")]` to allow override of default CoCreateInstance behaviour for coclasses \[ https://github.com/[twinbasic/lang-design/issues/52](https://github.com/twinbasic/lang-design/issues/52)#issuecomment-1265538725 \]
- Global/App/Screen/Clipboard classes are now defined within the WinNativeForms package
- WinNativeForms package types are now exposed via the `VB` qualifier \[ https://github.com/[/issues/1326](https://github.com/twinbasic/twinbasic/issues/1326) \]
- added check for OLEMISC\_NOUIACTIVATE flag in ActiveXExtender.OnFocus event \[ https://github.com/[/issues/1321](https://github.com/twinbasic/twinbasic/issues/1321) \]
- fixed: ComboBox CB\_SELCHANGE notification handling \[ https://github.com/[/issues/1327](https://github.com/twinbasic/twinbasic/issues/1327) \]

### BETA 167

- fixed: Click event ordering in LBN\_SELCHANGE (ListBox/FileListBox/DirListBox) \[ https://github.com/[/issues/1327](https://github.com/twinbasic/twinbasic/issues/1327)#issuecomment-1303666948 \]
- fixed: some `CoClass` resolving was crashing due to a compilation ordering issue \[ fafalone, discord \]

### BETA 168

- fixed: hover-info and F12/go-to-definition support for CoClass syntax \[ fafalone, discord \]
- added: support for attribute `[ ArrayBoundsCheck(False) ]` at procedure and component scope \[ wqweto, discord \]

### BETA 169

- added: support for attribute `[ FloatingPointErrorChecks(False) ]` at procedure and component scope
- fixed: tweaked RedrawWindow to use RDW\_UPDATENOW in many instances \[ fafalone, discord \]
- fixed: ListBox.Selected(Index) was not working correctly for single selection lists
- fixed: {ALL CONTROLS}.MousePointer/MouseIcon property updates are now reflected immediately \[ https://github.com/[/issues/1329](https://github.com/twinbasic/twinbasic/issues/1329) \]
- fixed: projects with CoClass declarations could sometimes crash the compiler \[ fafalone, discord \]