namespace ActiveX
{
[Guid("b4563c5d-3e00-4e82-bac4-a50da3d3f4d3")]
public partial class UserControl1 : UserControl, IObjectSafety
{
public UserControl1()
{
InitializeComponent();
}
public void GetInterfacceSafyOptions(int riid, out int pdwSupportedOptions, out int pdwEnabledOptions)
{
pdwSupportedOptions = 1;
pdwEnabledOptions = 2;
}
public void SetInterfaceSafetyOptions(int riid, int dwOptionsSetMask, int dwEnabledOptions)
{
throw new NotImplementedException();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("1111111");
Process.Start("mstsc.exe");
}
}
}
{
[Guid("b4563c5d-3e00-4e82-bac4-a50da3d3f4d3")]
public partial class UserControl1 : UserControl, IObjectSafety
{
public UserControl1()
{
InitializeComponent();
}
public void GetInterfacceSafyOptions(int riid, out int pdwSupportedOptions, out int pdwEnabledOptions)
{
pdwSupportedOptions = 1;
pdwEnabledOptions = 2;
}
public void SetInterfaceSafetyOptions(int riid, int dwOptionsSetMask, int dwEnabledOptions)
{
throw new NotImplementedException();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("1111111");
Process.Start("mstsc.exe");
}
}
}
本文详细介绍了在ActiveX命名空间中,通过继承UserControl并实现IObjectSafety接口来实现用户控件的安全选项获取和设置。包括初始化组件、获取接口安全选项和设置接口安全选项的方法实现。
5503

被折叠的 条评论
为什么被折叠?



