Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create COM component and ActiveX controls

Tags:

c#

.net

.net-3.5

Is is possible to create COM component and ActiveX controls in .Net (using c# language). I searched internet but i could`t get anything.

Thanks,
santhosh

like image 610
santhosh Avatar asked Oct 09 '08 10:10

santhosh


People also ask

What is ActiveX and COM?

ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide Web.

What is ActiveX controls in e commerce?

An ActiveX control is a small program that other applications can reuse to enable the same functionality, without the extra development work. These controls typically have been implemented as plugins to enhance various types of Internet Explorer (IE) web applications.


1 Answers

Declare an interface and implement it with class.
If you have parameters/return values that are not OLE Automation compatible (custom structs, enums and so on), you might need to decorate them with the MarshalAs attribute.
Add the GUID attribute to both.
Add the COMVisible attribute to both. Alternatively, you can mark the assembly with it.
Use tlbexp to generate a type library for native clients.

like image 84
Franci Penov Avatar answered Oct 10 '22 07:10

Franci Penov