Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hey guys,
I am trying to play a video in a Form with DirectX 9 but it doesn't work. :(
I have no experience with DirectX so I thought I have to start with a simple videoplayer.
I've got a video in my "Content" folder of the project which conatins an ".avi" file.
Heres my code:

C#
private void OpenVideo()
{
    try
    {
        Video stream = new Video(@"Content\Video.avi");
        stream.Owner = panelPlay;
        stream.Size = new Size(400, 400);
        stream.Play();
    }


Debugging works but the form is still blank. Can anyone help?

Edit: Okay I've got another problem.
I've forgot to call the method (shame on me).
Now the debugger gives an error "loader lock". The search in a famous search engine gives following results:
http://www.thezbuffer.com/articles/304.aspx[^]

I've tried to fix it with the workaround but now the debugger throws: "Application error".
Anyone knows how to fix it?
Posted
Updated 23-Feb-11 7:20am
v2
Comments
Sergey Alexandrovich Kryukov 23-Feb-11 14:47pm    
You probably have Framework 3.5 or later. Is there any reason for not using WPF?
--SA
Haechtsuppe 23-Feb-11 16:40pm    
Yes I am working in 3.5 but are there any problems with the usage of DX9?
I have very little experience with WPF and XAML but I think I'll take a small safari to the world of WPF tomorrow after regular work.

1 solution

The Loader lock exception is pretty common in VS when you use DX 9. In your project properties see the exceptions dialog and disable that exception. If you have no other exceptions in your application it will run fine!

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900