I’m creating a custom control in C# for a legacy application which only supports ActiveX. The control works fine in other applications, however the legacy application only checks the component category called ‘Controls’ and not the ‘.NET Category’, so it doesn’t show up in the list of available controls.
If I go into regedit and manually add the GUID for the ‘Control’ category to the Implemented Categories as below – the legacy application finds the control and inserts it no problem.
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{XXXXXXX-XXXX-XXXX-XXXX-XXXXXXX}\Implemented Categories\{40FC6ED4-2438-11CF-A3DB-080036F12502}
What I’m wondering is – is there an automated way to add such categories during build? During deployment, I don’t want the engineers to have to go into the registry and add this category. Is creating a registry patch the only way to go?
I’m using a Visual Studio project to create an .msi file for deployment of the control.
You can use ComRegisterFunctionAttribute. It enables you to add abritrary registration code.