首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Windows窗体无法使用DirectX.AudioVideoPlayback - C#显示

Windows窗体无法使用DirectX.AudioVideoPlayback - C#显示
EN

Stack Overflow用户
提问于 2011-10-06 21:33:32
回答 1查看 455关注 0票数 0

我试图用DirectX.AudioVideoPlayback制作一个媒体播放器应用程序,但当我尝试运行它时,项目成功构建,应用程序运行,但窗体不显示。应用程序在Application.Run()上挂起。然而,当我注释掉所有的DirectX代码时,应用程序就可以正常运行了。

下面是我的代码:

代码语言:javascript
复制
Video v_Video = null;

void MainFormLoad(object sender, EventArgs e)
{
    v_Video.Size = VideoViewer.Size; //VideoViewer is a PictureBox
    v_Video.Owner = VideoViewer;
}

void PlayButtonClick(object sender, EventArgs e)
{
    v_Video = new Video(File.ReadAllText("VideoLocation.txt") + "\\Video.wmv");
    v_Video.Play();
    PauseButton.BringToFront();
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-10-06 21:40:21

我以前用过这个DLL。当我尝试打开媒体文件时,Visual Studio抛出此异常:

'C:\Windows\assembly\GAC\Microsoft.DirectX\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.dll‘正在尝试在OS加载器锁中托管执行

DLL。不要试图在DllMain或图像初始化函数中运行托管代码,因为这样做可能会导致应用程序挂起。

我建议您使用其他库。看看here吧。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7674983

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档