Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Media Player

Status
Not open for further replies.

KenWK

Programmer
May 25, 2001
76
US
It's 2:30 and I'm desperate!

I'm using the Windows Media Control (wmp.dll) to play music files from a VB6 app. Having never used this contol it took some doing to figure how it worked but I eventually got it working with this simple code (WMPP is the name of a Windows Media Player control on the form--FullName$ is a valid mp3 file).

Dim Plyr As WindowsMediaPlayer
Set Plyr = Me.WMPP.object
Plyr.URL = FullName$
Plyr.Controls.play
MsgBox "playing?"
Plyr.Controls.Stop

After everything was working I removed what I thought were unnecessary "Windows Media Player" references from the project.

I THOUGHT (it is currently 2:30 am though so thought may not be too clear) that what made it work was adding a reference to wmp.dll AND adding the control that is the wpm.ocx. Now, however, I can't get wpm.ocx to load at all and no matter what combination of "Windows Media Player" references I use I get a Type Mismatch error on the 2nd line of code above.

wpm.ocx does NOT show up in my components list and when I browse to it I can an error that says it "was not registerable as an ActiveX component."

What the heck could I have done here?!?! The dang thing worked not an hour ago!

Any help is greatly, greatly appreciated.

Ken
 
OK, after 6 or so hours of sleep, I've now added a reference to wpm.dll AND added the control (the same wpm.dll) and, well, everything works with the simple code I'd shown in my last post.

How embarrassing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top