PDA

Click to See Complete Forum and Search --> : bstrFileName?


Seeker870
Nov 26th, 2001, 08:49 AM
I'm having problems getting the media player to work in VB. The pop-up suggests that the file name is 'bstrFileName'. I've never seen this 'bstr' before a file name indicator before. Anyone have any ideas what it could be indicating?

Or for that matter does anyone know of a good way to show an .avi file. While the .avi files themselves do not have sound, I will also need a way of playing .wav files.

Any suggestions?

The code I am using is simple and straightfoward (because I am testing out the concept):

Private Sub Command1_Click()
MediaPlayer1.FileName = App.Path & "\playball"
MediaPlayer1.Play
End Sub

The Error I get is:

Run-time error '-2147467259 (80004005)':
Method 'Play' of object 'IMediaPlayer2' failed

Debug suggests that the error is in the 'MediaPlayer1.Play' command, but I don't know why, how or anything else.
:confused:

Seeker870
Nov 26th, 2001, 03:04 PM
Obviously it doesn't since said string is in the code example that I gave, and I get the errror also quoted below.

But apparently it isn't in the code....

Which means I don't know what else to try.

Zaei
Nov 26th, 2001, 03:26 PM
Excuse me =). If you see bstr, give it a string, and it SHOULD work =).

I've gotten a lot of those sorts of errors with MS controls. In the end, I usually give up.

Z.

Seeker870
Nov 26th, 2001, 03:50 PM
Any ideas how I would get a window on a form that will play an avi? The animation control won't work because the program I am using to build the animations apparently adds a sould element.

Please be as specific as possible.

Zaei
Nov 26th, 2001, 05:48 PM
You could try running the MS Media Player control through the ActiveX Control Test Container, and try running it's methods from there. If you get the same errors, there is a bug in your Media Player control, most likely. I'd upgrade to the newest version availible.

Z.