Click here to Skip to main content
11,704,315 members (57,248 online)
Rate this: bad
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. 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()
        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
Edited 23-Feb-11 7:20am
SAKryukov at 23-Feb-11 14:47pm
You probably have Framework 3.5 or later. Is there any reason for not using WPF?
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
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
0 Sergey Alexandrovich Kryukov 740
1 OriginalGriff 495
2 Maciej Los 355
3 Andy Lanng 284
4 CPallini 267
0 OriginalGriff 8,824
1 Sergey Alexandrovich Kryukov 8,247
2 CPallini 5,197
3 Maciej Los 4,726
4 Mika Wendelius 3,606

Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 24 Mar 2011
Copyright © CodeProject, 1999-2015
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