Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/Features/Project-Configuration/ActiveX-Registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```