Last active
March 22, 2019 07:34
-
-
Save sailfish009/dbe317812bdee810ba5b0ad0525ab025 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// COM Data Types: | |
// https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/sak564ww(v=vs.90) | |
using System.Runtime.InteropServices; | |
namespace COMDLL | |
{ | |
[Guid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")] | |
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] | |
public interface IMyclass | |
{ | |
[DispId(1)] | |
int Add(int i, int j); | |
} | |
[Guid("yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy")] | |
[ComVisible(true)] | |
[ClassInterface(ClassInterfaceType.None)] | |
[ProgId("COMDLL.Myclass")] | |
public class Myclass : IMyclass | |
{ | |
public int Add(int i, int j) | |
{ | |
return i + j; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment