Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: DirectXC#3.5
Hey guys,
I am trying to play a video in a Form with DirectX 9 but it doesn't work. Frown | :(
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:
 
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 23-Feb-11 6:33am
Edited 23-Feb-11 7:20am
v2
Comments
SAKryukov at 23-Feb-11 14:47pm
   
You probably have Framework 3.5 or later. Is there any reason for not using WPF? --SA
Haechtsuppe at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 755
1 OriginalGriff 503
2 Abhinav S 253
3 thatraja 245
4 Emre Ataseven 190
0 Sergey Alexandrovich Kryukov 8,282
1 OriginalGriff 4,750
2 Peter Leow 3,784
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 24 Mar 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid