Implementing VLC player in a Windows application: Programatically registering an ActiveX component

人盡茶涼 提交于 2019-12-21 23:15:44

问题


Im using the following guide to implement a VLC player inside my windows application:

http://www.codeproject.com/Questions/163016/How-to-embed-VLC-control-in-c-net-windows-applicat

(see the top rated answer)

On step 2 in the guide, it says that I have to register the ActiveX component:

regsvr32 "D:\Program Files\VideoLAN\VLC\axvlc.dll"

How do I do this programatically in the software so that the user doesn't have to? Im unsure on how to proceed here. Can anyone help me?


回答1:


Please try this routine to register your dlls

    public static void RegisterDll(string filePath)
    {
        string fileinfo = String.Format(@"/s ""{0}""", filePath);
        Process process = new Process();
        process.StartInfo.FileName = "regsvr32.exe";
        process.StartInfo.Arguments = fileinfo;
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.CreateNoWindow = true;
        process.StartInfo.RedirectStandardOutput = true;
        process.Start();
        process.WaitForExit();
        process.Close();
    }


来源:https://stackoverflow.com/questions/10385686/implementing-vlc-player-in-a-windows-application-programatically-registering-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!