Click here to Skip to main content
12,891,581 members (47,586 online)
Rate this:
Please Sign up or sign in to vote.
See more: DirectX C#3.5
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:

private void OpenVideo()
        Video stream = new Video(@"Content\Video.avi");
        stream.Owner = panelPlay;
        stream.Size = new Size(400, 400);

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:[^]

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
Updated 23-Feb-11 7:20am
SAKryukov 23-Feb-11 14:47pm
You probably have Framework 3.5 or later. Is there any reason for not using WPF?
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

Rate this: bad
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!

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 24 Mar 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100