views:

21

answers:

2

I have an ActiveX component with no user interface that was created with C++ / Visual Studio 6.

Now I need to create a .NET component reusing the code. How do I go for this? Can I just wrap or embed the ActiveX inside a .NET component?

A: 

You can use Visual Studio 2005 or later and C++/CLI. This book can help you. The key feature is that you can mix managed and unmanaged code in the same project so you can theoretically reuse almost all your existing code.

renick
+1  A: 

.NET already supports these, nothing special is needed. All it needs is the type library for the component, it should be embedded in the DLL when you created it with VS6. In a .NET project, use Project + Add Reference, Browse tab and select the DLL. That automatically generates the interop library. Use Object Browser to verify that everything is there.

Hans Passant