Media player and WMA in VB6

Visual Basic

    Sponsored Links

    Next

  • 1. Inserting multiple pictures into a Word table cell
    Hi All Sorry for the cross-posts. Not sure what category my queries really fall into. My VB6 app inserts mutliple pictures into a Word doc template, but because I don't know whether it will be 1 image (with accompanying text) or 36 images (ditto) my idea was to just have a pre-created table of 1 row and 1 col and then just keep inserting the pic then text in a long vertical list, eg: Pic title of pic comment Pic title of pic comment Pic title of pic comment etc I've used the following code up to now: Set oPic = oNewDoc.Tables(1).Cell(1, 1).Range.InlineShapes.AddPicture _ (MyPics & "\DCP_1960.JPG", False, True) oPic.Width = 200 oPic.Height = 150 oNewDoc.Tables(1).Cell(1, 1).Range.Text = oNewDoc.Tables(2).Cell(2, 2).Range.Text & _ vbCrLf & "Jenny in Brid" & vbCrLf & "comments here" But as you will probably know already, I can't add another pic to the above code. If I do set oPic again then it overwrites the above pic and text. Is there anyway I can concat a number of pics and text to drop into 1 cell or have I got to have 1 cell for each pic?? Thanks
  • 2. Background picture doesn't display when taking copy off of a Word template
    Hi All Sorry for the myriad of posts from me today. I am trying to fathom stuff myself, but I'm on a hot streak of doing stuff today, but at the same time hitting a few brickwalls. Basically I have created a background image and applied to my MS Word template, eg Format / Background / Fill Effects and selected my pic from in there, and when I'm editing my template I see the bg image no probs. However when I call a copy of this template via my VB6 app, all of the text appears but my background image doesn't appear. If I go back to the template the image is still there, but for some reason my 'copies' don't get the image. I'm using Word 2003 is this a common problem? Is there a way round it? Thanks Mojo
  • 3. VB to Word - working with pictures in Word
    Hi All Does anybody know of any good tutorials regarding working with pictures in MS Word using VB6? Thanks
  • 4. Slow response to label.click event
    Hi, I have a label on a form and am using the label.click event to do a very simply task such as adding an item to a list box. If I rapidly click the label, I can only update the list box about every 300mS, ie clicking the lable updates the list box but then there is a delay before it is or can be updated again. If I add a command button and make the command button call the label.click event, the updating is virtually instantaneous, ie there is no discernable delay between clicking the command button and the list box being updated. Can anyone offer a suggestion how I might be able to make the response of clicking on the label as quick as clicking on the command button, please. Thanks, Peter
  • 5. locking out part of code in VB6
    I'm trying to lock out a part of the code depending on a status flag. However VB insists that it still needs the procedure that I've ocked out. Is there a way to make this work? StandAlone = True If StandAlone Then Call LineXX(0, 0, 100, 100) Else Call LineAA(0, 0, 100, 100) End If

Media player and WMA in VB6

Postby JR » Wed, 26 Apr 2006 20:49:35 GMT

Hi,

A want to play a WMA file in VB6.
I have a mediaplayer control from then msdxm.ocx lib
I use this code


'start code
Private Sub cmdPlay_Click()
  Dim sBestand As String
  If File1.ListIndex > -1 Then
    sBestand = File1.path & IIf(Right(sBestand, 1) = "\", "", "\") & 
File1.FileName
    With MediaPlayer1
      .FileName = sBestand
      If .FileName = "" Then
        Debug.Print sBestand
        MsgBox .ErrorCode & ": " & .ErrorDescription
      End If
    End With
  End If
End Sub
'end code

it works fine with mp3 and wav but I always get the errorcode : -2147467259 
and the discription  can't open check filename and try again
the discription is translated and can be someting like this.

some an idee 



Re: Media player and WMA in VB6

Postby Henning » Wed, 26 Apr 2006 21:44:17 GMT

"JR" < XXXX@XXXXX.COM > skrev i meddelandet



What is the following line supposed to do?
/Henning

: -2147467259



Re: Media player and WMA in VB6

Postby JR » Thu, 27 Apr 2006 06:58:09 GMT

Sorry
that must be

sBestand = File1.path & IIf(Right(File1.path, 1) = "\", "", "\") & 
File1.FileName

i Also get the error -2147221164 (class not registerd)

Jan
"Henning" < XXXX@XXXXX.COM > schreef in bericht 






Re: Media player and WMA in VB6

Postby Henning » Thu, 27 Apr 2006 07:13:27 GMT

What if you change it to this?
 File1.FileName
     With MediaPlayer1
       If sBestand = "" Then
         Debug.Print sBestand
         MsgBox .ErrorCode & ": " & .ErrorDescription
       Else
       .FileName = sBestand
       End If
     End With
/Henning

"JR" < XXXX@XXXXX.COM > skrev i meddelandet







Re: Media player and WMA in VB6

Postby Henning » Thu, 27 Apr 2006 07:26:11 GMT

Also try:
MsgBox .ErrorNumber & ": " & .ErrorMessage
/Henning

"Henning" < XXXX@XXXXX.COM > skrev i meddelandet








Re: Media player and WMA in VB6

Postby JR » Thu, 27 Apr 2006 18:31:20 GMT

hi,

ErrorNumber &  ErrorMessage are not recognised
Remember it works fine for mp3 and wav

Jan


"Henning" < XXXX@XXXXX.COM > schreef in bericht 









Re: Media player and WMA in VB6

Postby JR » Fri, 28 Apr 2006 08:56:21 GMT

ore testing brengs me to the following

opening a wma in the formload has no problem

after running the code: Set oWMP = New WindowsMediaPlayer
I can't play any wma anymore
the windowsmediaplayer came from the reference wmp.dll
I use the wmp to read the wma tag info. So if i can read the taginfo with
another method the problem is solfed to

Jan


"JR" < XXXX@XXXXX.COM > schreef in bericht
news:I5H3g.392493$ XXXX@XXXXX.COM ...



Re: Media player and WMA in VB6

Postby Henning » Fri, 28 Apr 2006 09:07:42 GMT

'm sorry to say I have no more ideas. You might get some hints from this
link.
http://www.a1vbcode.com/code.asp?type=multimedia&intPage=3

/Henning

"JR" < XXXX@XXXXX.COM > skrev i meddelandet
news:FMT3g.393574$ XXXX@XXXXX.COM ...
"\")



Re: Media player and WMA in VB6

Postby Henning » Fri, 28 Apr 2006 10:17:56 GMT

ust curious :)
I put mediaplayer from msdxm.ocx and placed a button on a form and voila it
plays ok.
Private Sub Command1_Click()
MediaPlayer1.FileName = "C:\30 Hank Marvin - Nights In White Satin.wma"
End Sub

Is your .wma file playing in windows mediaplayer?
Is your .wma file copyrighted?

/Henning

"JR" < XXXX@XXXXX.COM > skrev i meddelandet
news:FMT3g.393574$ XXXX@XXXXX.COM ...
"\")



Re: Media player and WMA in VB6

Postby JR » Fri, 28 Apr 2006 16:28:23 GMT

es on both
that code works fine
It plays in wmp
and no no protection

it goes wrong after running the code: Set oWMP = New WindowsMediaPlayer
(wmp.dll)
i have tryed some code like your example in the formload and no problems,
but like i wrote after the needed code for reading the wma tags its no
longer possible to play wma but mp3 has no errors

Jan


"Henning" < XXXX@XXXXX.COM > schreef in bericht
news:44501ead$0$6626$ XXXX@XXXXX.COM ...



Similar Threads:

1.I need code select soundcard media player in vb6

As I do to select the audio out with the windows measured player in the 
visual basic 6?! Please send me code for example.
Thanks!...

2.windows media player component in VB6

3.Handle to Windows Media Player 9.0 in VB6.0

How can I get a handle to a running instance of wmplayer.exe in VB6.0?
Should be something with GetObject(???)?

For instance I would like to programmatically be able to play the next song
without starting a new instance of WMP9.0.

4.Media Player in VB6

I am having a tough time with this control - WindowsMediaPlayer.

I can't get the control to be enabled in my app to use the
stop/play... . The only way it works now is it brings up the full
windows media player on to of the app. How do I get the control to
work inside my app without bringing up the media player window?

Thanks



Return to Visual Basic

 

Who is online

Users browsing this forum: No registered users and 27 guest