[DllImport("libvlc")]
private unsafe static extern void libvlc_media_player_set_hwnd(CoreHandle coreHandle, void* drawable);
错误 2 不安全代码只会在使用 /unsafe 编译的情况下出现
//设置父窗口
unsafe public void VedioSetParent(CoreHandle coreHandle, IntPtr hear)
{
libvlc_media_player_set_hwnd(coreHandle, (hear.ToPointer()));
}
错误 1 不安全代码只会在使用 /unsafe 编译的情况下出现 错误在于void* drawable 进行了强转 在xxx.dll里 接口为
/**
* Set a Win32/Win64 API window handle (HWND) where the media player should
* render its video output. If LibVLC was built without Win32/Win64 API output
* support, then this has no effects.
*
* \param p_mi the Media Player
* \param drawable windows handle of the drawable
*/
LIBVLC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
怎么实现C#代码的修改啊...
private unsafe static extern void libvlc_media_player_set_hwnd(CoreHandle coreHandle, void* drawable);
错误 2 不安全代码只会在使用 /unsafe 编译的情况下出现
//设置父窗口
unsafe public void VedioSetParent(CoreHandle coreHandle, IntPtr hear)
{
libvlc_media_player_set_hwnd(coreHandle, (hear.ToPointer()));
}
错误 1 不安全代码只会在使用 /unsafe 编译的情况下出现 错误在于void* drawable 进行了强转 在xxx.dll里 接口为
/**
* Set a Win32/Win64 API window handle (HWND) where the media player should
* render its video output. If LibVLC was built without Win32/Win64 API output
* support, then this has no effects.
*
* \param p_mi the Media Player
* \param drawable windows handle of the drawable
*/
LIBVLC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
怎么实现C#代码的修改啊...
[DllImport("libvlc")]
public static extern void libvlc_media_player_set_hwnd(CoreHandle coreHandle, IntPtr drawable);
public static extern void libvlc_media_player_set_hwnd(ref libvlc_media_player_t p_mi, IntPtr drawable);
unsafe class xx
{
[DllImport("libvlc")]
public static extern void libvlc_media_player_set_hwnd
...
}
编译设置中勾上 允许使用不安全代码.