Hi. I've been having a problem...
I made a little C# program with directX (a media player, using the DirectX 9 AudioVideoPlayback). The problem is, it runs perfectly on my computer, a friend told me it ran on his, but yesterday night the one who asked for the program brought me his computer because it refused to run on it.
It has DirectX 9 installed, and the .NET framework. I copied some of the DX SDK samples to his PC, and the managed ones also refused to run (the non-managed, all ok)
I got to the Direct9 setup, and tried to install the .cab that contains the managed DX (Is it necesary to do it manually?), and that got the managed samples to run, but my app (wich is essentially like one of the samples) still refused to.
The best thing I managed to figure out is that it is throwing me an "InvalidCastException" (that is the java name of the exception, forgot c# name, but I'm referring to the exception with the same meaning).
The line that causes the exception goes like this:
filename being a string,
and the VideoInfo constructor says
As you can see, there is no cast there whatsoever.
What boggles me more is that it throws the exception BEFORE showing the messagebox (thus, I never get to see the messagebox).
And, I can call static methods of the VideoInfo class (that doesn't contain any reference to the video class).
I also tried making a setup proyect to install the app, it created the AudioVideoPlayback dll (don't remember the full name), I copied it into the executable directory, and it still refused to work (At the other computer where the app worked, it refused to work without that dll, and began working as soon as I copied it)
And, as a final step to my experiments, I commented out every line referring to the 'Video' class. Surprise. The messagebox appeared (though obviously my app didn't do what it was suposed to do)
My question is, what could be happening? I'm about to format his hard disk and reinstall windows, framework and directx from scratch, but that makes no sense.
Also, why does my app requires the AudioVideoPlayback dll in the same directory, and the samples in the SDK that use the AudioVideoPlayback namespace don't?
I made a little C# program with directX (a media player, using the DirectX 9 AudioVideoPlayback). The problem is, it runs perfectly on my computer, a friend told me it ran on his, but yesterday night the one who asked for the program brought me his computer because it refused to run on it.
It has DirectX 9 installed, and the .NET framework. I copied some of the DX SDK samples to his PC, and the managed ones also refused to run (the non-managed, all ok)
I got to the Direct9 setup, and tried to install the .cab that contains the managed DX (Is it necesary to do it manually?), and that got the managed samples to run, but my app (wich is essentially like one of the samples) still refused to.
The best thing I managed to figure out is that it is throwing me an "InvalidCastException" (that is the java name of the exception, forgot c# name, but I'm referring to the exception with the same meaning).
The line that causes the exception goes like this:
Code:
VideoInfo vi = new VideoInfo(filename)
filename being a string,
and the VideoInfo constructor says
Code:
public VideoInfo (string filename)
{
MessageBox.Show("Debug: construyendo VideoInfo con "+filename);
Video v = new Video(filename);
this.Duration = v.Duration;
/// get some other data about the video.
}
As you can see, there is no cast there whatsoever.
What boggles me more is that it throws the exception BEFORE showing the messagebox (thus, I never get to see the messagebox).
And, I can call static methods of the VideoInfo class (that doesn't contain any reference to the video class).
I also tried making a setup proyect to install the app, it created the AudioVideoPlayback dll (don't remember the full name), I copied it into the executable directory, and it still refused to work (At the other computer where the app worked, it refused to work without that dll, and began working as soon as I copied it)
And, as a final step to my experiments, I commented out every line referring to the 'Video' class. Surprise. The messagebox appeared (though obviously my app didn't do what it was suposed to do)
My question is, what could be happening? I'm about to format his hard disk and reinstall windows, framework and directx from scratch, but that makes no sense.
Also, why does my app requires the AudioVideoPlayback dll in the same directory, and the samples in the SDK that use the AudioVideoPlayback namespace don't?