I was just going working through this issue on a different thread in this
news group... This is what I finally came up with:
using System;
using System.Runtime. InteropServices ;
namespace Squarei
{
//DEFINE THE PUBLIC INTERFACE FOR THE COM OBJECT
public interface IComInteropTest
{
void SetHTML(string strHtml);
string GetHTML();
}
//IMPLEMENT THE CLASS BELOW USING THE PUBLIC INTERFACE DEFINED ABOVE
[ClassInterface( ClassInterfaceT ype.None)]
public class ComInteropTest : IComInteropTest
{
public string strUrl = string.Empty;
public string strHtml = string.Empty;
public void SetHTML(string strHtml)
{
this.strHtml = strHtml;
}
public string GetHTML()
{
return strHtml;
}
}
}
--
Jay Douglas
Fort Collins, CO
"Luke Briner" <lu***********@ cheerful.com> wrote in message
news:bj******** **@hercules.bti nternet.com...
My ActiveX Container requires certain properties to be exposed by
components - properties that appear under the properties section in the
IDL/type library file.
C# properties are exposed as methods and the interfaces that my c# class
implements cannot contain fields in order to expose these as properties.
Can anyone tell me how to expose c# code as COM (IDL) properties.
Thanks