web上嵌入的控件如何实现IMessageFilter.PreFilterMessage?

panyee 2003-11-06 12:07:54
OBJECT id="simpleControl1" style="WIDTH: 373px; HEIGHT: 367px" height="367" width="373"
classid="TwainDll.dll#TwainDll.UserControl1" VIEWASTEXT>
</OBJECT>


TwainDll是一个windows控件库, 它的控件继承了IMessageFilter接口

public class UserControl1 : System.Windows.Forms.UserControl, IMessageFilter
{
....
}


如果把控件拿到winforms中, 它可以正常运行, 但是在web 上它无法实现消息过滤??

请问如何实现?
...全文
153 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
panyee 2003-11-07
  • 打赏
  • 举报
回复
用重载DefWndProc实现了
rqxiang 2003-11-06
  • 打赏
  • 举报
回复
gz!
saucer 2003-11-06
  • 打赏
  • 举报
回复
most likely, it is security issues, if you look at the Security requirement for Application.AddMessageFilter:

SecurityPermission for the immediate caller to call unmanaged code.

try to give the permissions to call unmanaged code in

Adminstrative Tools->Microsoft .NET Framework Configuration, right click on Runtime Security Policy, select New or Adjust Policy..., follow the instructions...

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧