Can I use C# to build ActiveX control?

  • Thread starter Thread starter seaweed
  • Start date Start date
S

seaweed

Hi, all.

I am a beginner. If C# can not be used to ActiveX control, How can I do?
Thank you in advance.
 
You can't... if you're using VS.Net, you can create an ActiveX control via
C++'s MFC ActiveX Wizard...

You can, however, use an ActiveX control inside a C# application. The VS.Net
creates an interop DLL, which allows the unmanaged code to communicate with
the .Net IL.

hope that helps.
Dan.

Hi, all.

I am a beginner. If C# can not be used to ActiveX control, How can I do?
Thank you in advance.
 
C# is a language for the .NET platform which does not provide native
support for COM/ActiveX. Microsoft had many reasons for breaking
compatibility, but they did provide an interop layer you can go
through for COM objects. Unfortunately their is no backwards interop
for ActiveX.

Depending on you application you may can create .NET UserControl (this
is the .NET counterpart for an ActiveX control), unfortunately
UserControls do not support ActiveX containers (you can't embed your
..NET UserControl in an Office document), but they do support the
current version of Internet Explorer when the client has the .NET
Framework and Code Access Security configured to permit their
execution.

If you want to create an ActiveX component you'll need Visual Basic 6
or Visual C++.
 
Back
Top