Difference between r5 and r6 vis ActiveX objects

I have the following code, which works fine in r5, but errors out with the indicated message in r6.

Code
Dim oRo
Set oRo = createObject(“RoAx.RoFrmInput”)

Error in r6
ActiveX component can’t create object 'Roax.RoFrminput"

Both Rhino versions have registry subkeys for the plugins under their respective keys and the dll is registered. There is a subkey for RoFrmInput.

I tried running both the compiled plugin and from the RhinoScript editor in both Rhino versions.

What more do I need to do in r6?

Hi @cestes001,

Rhino 5 came in 32-bit and 64-bit flavors.

Rhino 6 is 64-bit only.

If your ActiveX component is 32-bit, it’s not going to work in 64-bit Rhino.

Hope this helps.

– Dale

It does help, but sets up a roadblock. I want to use my plugin, developed long ago, and I’m tunneling through a maze of such roadblocks.

Is there a development path where I can create a 32/64 bit plugin that will run in Rhino 5 - whatever comes next?

On the page

A template for Rhino 7 is discussed. Does this template preclude developing for r5 or r6?

If I’m to write all new code to replace the old plugin, I’d like it to be as universally applicable as possible.

Hi @cestes001,

For Rhino 5, you will need this:

To work on any CPU, you will want to build a RhinoCommon plug-in. RhinoCommon plug-in’s are based on .NET, and .NET assemblies are compiled “just in time”, so you don’t need to target any specific platform.

RhinoCommon plug-ins for Rhino 5 use the .NET Framework 4.0. So you can use newer Visual Studios, as long as your plug-in project targets this framework and references the Rhino 5 .NET assemblies. You can also just use this Nuget package.

– Dale

So, If I understand correctly, I can write code once in VS2022 and compile it for all versions from 5-whatever?

You’ll have to do some project file massaging to set up for different Rhino versions, but it is possible.

You can directly edit the csproj file in a text editor. Using a mixture of well placed conditionals and configurations you can tweak the values of different settings as necessary, like referencing specific nuget packages etc.

Read up on msbuild conditionals and maybe look at other project files, like CCSycles/csycles.csproj at rhino-8.x · mcneel/CCSycles · GitHub and others.