S
shengmin.ruan
when i use delegate like this:
-----------------
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand,
Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
delegate_ReplyFromDataProcess = new
PrepareDelegate_ReplyFromDataProcess(ReplyFromDataProcess);
delegate_ReplyFromDataProcess.BeginInvoke(m, null, null);
}
delegate void PrepareDelegate_ReplyFromDataProcess(Message m);
private void ReplyFromDataProcess(Message m)
{
IntPtr pnt = dp.OnReply(UInt32.Parse(m.WParam.ToString()),
Int32.Parse(m.LParam.ToString()));
}
-----------------
i met the error:
*********
{"Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."}
*********
but if i changed the code like this:
--------------
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand,
Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
IntPtr pnt = dp.OnReply(UInt32.Parse(m.WParam.ToString()),
Int32.Parse(m.LParam.ToString()));
}
-----------------
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand,
Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
delegate_ReplyFromDataProcess = new
PrepareDelegate_ReplyFromDataProcess(ReplyFromDataProcess);
delegate_ReplyFromDataProcess.BeginInvoke(m, null, null);
}
delegate void PrepareDelegate_ReplyFromDataProcess(Message m);
private void ReplyFromDataProcess(Message m)
{
IntPtr pnt = dp.OnReply(UInt32.Parse(m.WParam.ToString()),
Int32.Parse(m.LParam.ToString()));
}
-----------------
i met the error:
*********
{"Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."}
*********
but if i changed the code like this:
--------------
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand,
Name = "FullTrust")]
protected override void WndProc(ref Message m)
{
IntPtr pnt = dp.OnReply(UInt32.Parse(m.WParam.ToString()),
Int32.Parse(m.LParam.ToString()));
}