Click here to Skip to main content
15,884,938 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I have installed DirectX sdk, but when I play my project it has a problem.
the problem is "BadImageFormatException was unhandled". i think it has problem with directX skd. i have installed it in default path. what should i do?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX.AudioVideoPlayback;
namespace test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        Video v = new Video("e:\\GEM TV noevent 20100129_230128 #1.mpg");
        private void button1_Click(object sender, EventArgs e)
        {
            v.Play();
        }
    }
}
Posted
Updated 16-Dec-10 9:58am
v3
Comments
JF2015 16-Dec-10 1:16am    
Please tell us what exactly is the problem you are facing. Any error message?
Sandeep Mewara 16-Dec-10 1:20am    
You missed the most important part - *what problem*? Any error?

Update the question with the issue.

Is this[^] helpful?
 
Share this answer
 
Comments
mehdi_k 17-Dec-10 2:45am    
thanks, it was helpful, the "BadImageFormatException was unhandled" was solved, but new problem name :"LoaderLock was detected"!!
i don't know what's wrong!
Marc A. Brown 17-Dec-10 8:46am    
I found this by pasting your error message into google: http://stackoverflow.com/questions/926947/loaderlock-was-detected-in-multithreaded-c-application
If it doesn't help, I'd recommend creating a new question for this new error.
mehdi_k 17-Dec-10 13:22pm    
thank u, it was good, i have solved it by choosing release for configuration.
thank u again!
Marc A. Brown 17-Dec-10 13:26pm    
Glad I could help. If you don't mind, will you accept this answer since it seems to have solved your issue?
Your issue has to do with the instance of class video. You have tell it where it can render the video (video.Owner = ). Second the code you posted looks a bit weird as the declaration and initialization of Video v is inside the class and not inside a method. I don't know if that was what you intended.

add a panel to your form let's say its name be videoPanel and change your code to this:
C#
using System;using System.Collections.Generic;
using System.ComponentModel;using System.Data;
using System.Drawing;using System.Linq;
using System.Text;using System.Windows.Forms;
using Microsoft.DirectX.AudioVideoPlayback;
namespace test{
    public partial class Form1 : Form
    {
        private Video v;
        public Form1()
        {
            InitializeComponent();
            v = new Video("e:\\GEM TV noevent 20100129_230128 #1.mpg");
            v.Owner = videoPanel;
        }
        
        private void button1_Click(object sender, EventArgs e)
        {
            v.Play();
        }
    }
}


I hope that helps you!


Regards,


Manfred
 
Share this answer
 
v3
Comments
mehdi_k 16-Dec-10 14:50pm    
It doesn't work again!
the problem is "BadImageFormatException was unhandled".
i think it has problem with directX skd. i have installed it in default path.
what should i do?

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