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 失败 错误提示是安全透明方法无法调用本机代码,需要安全关键或安全可靠关键才可以。这怎么解决啊。
解决方案