diff --git a/docs/Features/Project-Configuration/ActiveX-Registration.md b/docs/Features/Project-Configuration/ActiveX-Registration.md index cbe6b9d76..e7eec5fb6 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: + +```tb check_build +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 +``` + + +