方法调用AVICAP32.dll 失败 错误提示是安全透明方法无法调用本机代码,需要安全关键或安全可靠关键才可

.Net技术 码拜 7年前 (2017-04-27) 1536次浏览
 public VideoCapturer(Control control, int index)
        {
            this.index = index;
            m_hwnd = capCreateCaptureWindow("", WS_VISIBLE | WS_CHILD, 0, 0, control.Width, control.Height, control.Handle, 0);
            if (m_hwnd == IntPtr.Zero) throw new AVException();
            m_parms = new CaptureParms();
            m_streamCallBack = new  capVideoStreamCallback(this.streamCallBack);
            m_errorCallBack = new capErrorCallback(this.capErrorCallback);
            SendMessage(m_hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, m_streamCallBack);
            SendMessage(m_hwnd, WM_CAP_SET_CALLBACK_ERRORA, 0, m_errorCallBack);
        }
        [DllImport("AVICAP32.dll")]
        private static extern IntPtr capCreateCaptureWindow(
			string lpszWindowName,
			int dwStyle,
			int x, int y, int nWidth, int nHeight,
			IntPtr hwndParent, int nID);

方法调用AVICAP32.dll 失败 错误提示是安全透明方法无法调用本机代码,需要安全关键或安全可靠关键才可以。这怎么解决啊。

解决方案

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明方法调用AVICAP32.dll 失败 错误提示是安全透明方法无法调用本机代码,需要安全关键或安全可靠关键才可
喜欢 (0)
[1034331897@qq.com]
分享 (0)