Satya,
Here's an example of how things are defined in C# for ATL to catch the
event.
Define a delegate & a corresponding event. Also an interface containing
equivalent method. Note the event instance name, must be same as the
interface method for AtlAdvise to succeed.
public event DefaultButtonHandler DefaultButton;
// Delegate Definitions...
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IHostMessageSink
{
[DispId(1)] void DefaultButton(int nCtrlIndex);
}
//C# side
public delegate void DefaultButtonHandler(int nCtrlIndex);
[
ComVisible(true),
Guid("1A151E44-FE24-4172-8D5D-FD7A30BA85EB"),
ClassInterface(ClassInterfaceType.None),
ComSourceInterfaces(typeof(IHostMessageSink))
]
public class CWindowHost : System.Windows.Forms.UserControl
{
// Event Definitions..
public event DefaultButtonHandler DefaultButton;
}
Try this out.
Thanks,
VT
> Hi Everybody,
> We have C# component. which has been hosted in ATL composit control.
[quoted text clipped - 5 lines]
> Regards,
> satya