I have a C# .NET 4.5 user control that I need to make available to a legacy project in VB6. (Part of a slow migration away from VB, but we can't do it all at once.)
I have been using a sample .NET-based, C# ActiveX control project from Microsoft from
https://code.msdn.microsoft.com/windowsapps/csactivex-b86194f8
I can get the project to build and I can register the .DLL it creates on the target machine using regasm like
%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\regasm.exe CSActiveX.ocx /codebase
and that registers without a problem.
However, when I look in VB I do not see the control as a component and when I try to "manually" add it by browsing to the control and adding it I get the error message
The file XXXXXX is not registerable as an ActiveX component.
(Note I have been trying this, and the regasm step with the DLL using both a .DLL extension and a .OCX extension on the file. I am not sure if that matters. I get the same error either way.)
I am assuming that VB6 is giving me this error because the ActiveX component needs to be registered with regasm.exe and it is trying to register it with RegSvr32. How do I get around this?