Answer the question
In order to leave comments, you need to log in
C# Creating a COM Object
I created my own com-object according to the lessons.
I specified everything in Assembly.
I call: regasm COMTest.dll
I get: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);
}
}
}
Answer the question
In order to leave comments, you need to log in
The error was class ComObject : IComObjectClass
inpublic class ComObject : IComObjectClass
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question