[Openroad-users] OpenROAD and .net COM
Paul White
shift7solutions at gmail.com
Tue Oct 9 10:41:21 EST 2007
Here's a mini project put together by a 1st year uni student learning C# and
OpenROAD.
Paul
(ps sorry for posting C# code on an OpenROAD forum)
-----
using System;
using System.Runtime.InteropServices;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace MyComDll
{
[Guid("694C1820-04B6-4988-928F-FD858B95C880")]
public interface SayHelloDll
{
[DispId(1)]
void Hello(string name);
}
[Guid("47C976E0-C208-4740-AC42-41212D3C34F0"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface SayHelloDll_Events
{
}
[Guid("9E5E5FB2-219D-4ee7-AB27-E4DBED8E123E"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(SayHelloDll_Events))]
public class SayHelloDll_Class : SayHelloDll
{
public SayHelloDll_Class()
{
}
public void Hello(string name)
{
MessageBox.Show("Hello" + name);
}
}
}
-----
on click my_btn =
declare
LocalCom = my_com!SayHelloDll_class;
enddelare
{
LocalCom.Hello('paul');
}
More information about the Openroad-users
mailing list