Building OCX with VS.NET?

What happened to OCX? Is it possible that they cannot be created using the latest tools?

I need to create an ActiveX control that can be placed in Word, PowerPoint, and Excel documents. If I use VS.NET, I can create a UserControl DLL with COM Interop, but I don’t think I can add this using the "Advanced Controls" toolbar of the PowerPoint Developer tab.

What would you do?

+4
source share
4 answers

Yes, you can still create them. But you cannot create OCX with the .NET language. You must be unmanaged C ++ (or VB). COM interoperability DLLs that you can create in C # or VB.NET are simply .NET objects that are invoked through CCW.

+3
source

You can use .NET to create ActiveX components. However, this is experimental and not recommended. If you still want to try, you can find the information on Andrew Whitechapel's blog:

Using managed controls as ActiveX controls

But as Andrei says:

This seems to be fine for Excel (with very limited testing that I did), partially works with PowerPoint, but fails with Word.

So, if you do not want to spend a lot of time debugging strange errors, I would recommend that you use the old VB 6.0 and Visual Studio 6.0 to create ActiveX components.

+3
source

Use a C ++ or VB compiler that can focus on native + ActiveX code.

0
source

Depending on what you need to do, the add-in may be more suitable than OCX, and you can certainly create those that have .NET. You should also take a look at Visual Studio Tools for Office, not a direct replacement for OCX, but only to understand the new features. He can show you new approaches to solving the problems that you are now solving with the help of OCX.

0
source

All Articles