From 0559701fe2a0f6331d072c013e62723c6e1dcff7 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 1 Dec 2026 02:23:14 -0500 Subject: [PATCH 1/2] Add custom registration section to ActiveX documentation Added section on custom registration for ActiveX projects, including example code for DllRegisterServer and DllUnregisterServer methods. --- .../ActiveX-Registration.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/Features/Project-Configuration/ActiveX-Registration.md b/docs/Features/Project-Configuration/ActiveX-Registration.md index cbe6b9d76..ccb0cdcdf 100644 --- a/docs/Features/Project-Configuration/ActiveX-Registration.md +++ b/docs/Features/Project-Configuration/ActiveX-Registration.md @@ -23,3 +23,24 @@ Register ActiveX builds to `HKEY_LOCAL_MACHINE` or `HKEY_CURRENT_USER` option. W Registration at build time is optional. The *Register DLL after build* setting in [Project Settings](../../tB/IDE/Project-Settings#register-dll-after-build) lets you disable automatic registration, if for example you wanted to move the file first. [ActiveX registration](../../tB/IDE/Building/ActiveX-Registration) describes what the IDE shows when a build registers a DLL, the warning for a project that registers to `HKEY_LOCAL_MACHINE`, and what **Clean** removes. + +## Custom Registration + +In addition to the automatic registration/unregistration process that twinBASIC creates, you are able to define custom code to run. To do this, your project can include its own `DllRegisterServer()` and/or `DllUnregisterServer()` methods in a Standard Module. These will run *in addition* to the standard implementations of those functions the compiler inserts into a built ActiveX project. They should not be marked as DLL exports. A typical use for this would be for shell extensions, where additional registry entries are typically placed in a .reg file; you could use this feature instead so the .reg file is not needed. Example: + +```vb +Module Registration + Public Function DllRegisterServer() As Boolean + 'Apply custom registrations + Return True + End Function + + Public Function DllUnregisterServer() As Boolean + 'Remove custom registrations + Return True + End Function +End Module +``` + + + From aec3d05271aabd6016fdff8fdefc52df54c912d8 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 1 Dec 2026 15:48:18 -0500 Subject: [PATCH 2/2] Revise formatting of ActiveX registration addition vb->tb check_build --- docs/Features/Project-Configuration/ActiveX-Registration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Features/Project-Configuration/ActiveX-Registration.md b/docs/Features/Project-Configuration/ActiveX-Registration.md index ccb0cdcdf..e7eec5fb6 100644 --- a/docs/Features/Project-Configuration/ActiveX-Registration.md +++ b/docs/Features/Project-Configuration/ActiveX-Registration.md @@ -28,7 +28,7 @@ Registration at build time is optional. The *Register DLL after build* setting i In addition to the automatic registration/unregistration process that twinBASIC creates, you are able to define custom code to run. To do this, your project can include its own `DllRegisterServer()` and/or `DllUnregisterServer()` methods in a Standard Module. These will run *in addition* to the standard implementations of those functions the compiler inserts into a built ActiveX project. They should not be marked as DLL exports. A typical use for this would be for shell extensions, where additional registry entries are typically placed in a .reg file; you could use this feature instead so the .reg file is not needed. Example: -```vb +```tb check_build Module Registration Public Function DllRegisterServer() As Boolean 'Apply custom registrations