|
using System;
using System.Runtime.InteropServices;
namespace [!output SAFE_NAMESPACE_NAME]
{
#region Events raised by your COM class
//
// TODO: Insert delegates for events raised by your class here.
//
//public delegate void Event1Handler(int i, int j);
[ Guid("[!output GUID_EVENTS]"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch) ]
public interface [!output EVENTS_NAME]
{
//
// TODO: Insert event handlers for events your class raises here.
//
//[DispId(1)] void Event1(int i, int j);
}
#endregion
#region Interface published by your COM class
[ Guid("[!output GUID_INTERFACE]"),
InterfaceType(ComInterfaceType.InterfaceIsDual) ]
public interface [!output INTERFACE_NAME]
{
//
// TODO: Insert functions your class publishes here.
//
//[DispId(1)] int Function1(string s1, string s2);
}
#endregion
[ Guid("[!output GUID_COCLASS]"),
ProgId("[!output SAFE_NAMESPACE_NAME].[!output CLASS_NAME]"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof([!output EVENTS_NAME])) ]
public class [!output CLASS_NAME] : [!output INTERFACE_NAME]
{
//
// TODO: Insert events raised by your class here.
//
//public event Event1Handler Event1;
// A COM class must have a public parameterless constructor.
// Otherwise the class might not be registered for COM and
// cannot be created by CreateObject.
public [!output CLASS_NAME]() : base()
{
}
//
// TODO: Implement the methods of your class interface here.
//
//public int Function1(string s1, string s2)
//{
// return 0;
//}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.