Home
Manage Your Code
Snippet: Define COM interface for c# classes (C#)
Title: Define COM interface for c# classes Language: C#
Description: Define COM interface for c# classes Views: 398
Author: david vĂ­lchez Date Added: 7/13/2010
Copy Code  
1    [ComVisible(true)]
2    [Guid("096DAFAC-3135-45C0-A02D-6AE694DA40F6")]
3    public interface IFormulario
4    {
5       //define interface

6    }
7    
8    [ComVisible(true)]
9    [ClassInterface(ClassInterfaceType.None)]
10    [Guid("1C4C32C3-1313-4619-BD13-530FA70CC8A5")]
11    public class Formulario : IFormulario
12    { 
13            //some code

14    }
Notes
Generate tlb: regasm /tlb name.tlb name.dll Register in GAC. gacutil /i name.dll