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:07] 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 = | ||
- | Source: [[http:// | + | |
- | + | ||
- | * Start VS2010 as administrator. | + | |
- | | + | |
* Interface: | * Interface: | ||
* Add to the file:< | * Add to the file:< | ||
Line 23: | 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 class for COM: | Example class for COM: | ||
<code csharp> | <code csharp> | ||
Line 77: | Line 74: | ||
Hello, World, from a COM object | Hello, World, from a COM object | ||
</ | </ | ||
+ | |||
+ | == References == | ||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// |