Создал по урокам свой com-объект.
В Assembly всё указал.
Вызываю:
regasm COMTest.dll
Получаю:
RegAsm : warning RA0000 : No types were registered
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace COMTest
{
/// <summary>
///
/// </summary>
[Guid("E352B5AF-B38E-4688-AE66-880AB8CC976E")]
public interface IComObjectClass
{
[DispId(1)]
void Launch(string mymessage);
}
/// <summary>
///
/// </summary>
[Guid("7F6700DC-93A3-438D-9357-F5076148E89D"), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IComObjectEvents
{
}
[ClassInterface(ClassInterfaceType.None),
Guid("59FF1E93-9C22-4E23-A2EE-27D7270FCAD2"),
ComSourceInterfaces(typeof(IComObjectEvents))]
class ComObject : IComObjectClass
{
public ComObject()
{
}
public void Launch(string mymessage)
{
MessageBox.Show((mymessage.Equals(String.Empty) ? "Hello!" : "Hello " + mymessage), "Тест библиотека", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}