Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
swdev:dotnet:creating_com_library [2012/05/14 16:08] smayr |
swdev:dotnet:creating_com_library [2012/05/16 12:40] (current) smayr [Creating COM Library] |
||
---|---|---|---|
Line 1: | Line 1: | ||
= Creating COM Library = | = Creating COM Library = | ||
- | * Start VS2010 as administrator. | + | * Create |
- | * Open a Class Library project (Eg: MyLib). | + | |
* Interface: | * Interface: | ||
* Add to the file:< | * Add to the file:< | ||
Line 21: | Line 20: | ||
}</ | }</ | ||
* Add the attributes '' | * Add the attributes '' | ||
- | [InterfaceType(ComInterfaceType.InterfaceIsDual)] | + | [ClassInterface(ClassInterfaceType.None)] |
[Guid(" | [Guid(" | ||
[ProgId(" | [ProgId(" | ||
* '' | * '' | ||
* Activate COM and register it: | * Activate COM and register it: | ||
- | * In Project Properties (Alt-Tab) > Application > Assembly Information, | + | * In Project Properties (Alt-Enter) > Application > Assembly Information, |
- | * In Project Properties (Alt-Tab) > Build > Output, and check " | + | * In Project Properties (Alt-Enter) > Build > Output, and check " |
* Build the project. This will register the COM object. | * Build the project. This will register the COM object. | ||
* Alternatively, | * Alternatively, | ||
Now the COM object is available to be called by its '' | Now the COM object is available to be called by its '' | ||
- | |||
== Example == | == Example == | ||
Example class for COM: | Example class for COM: | ||
Line 81: | Line 79: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
- |