Media player and WMA in VB6

Visual Basic

    Sponsored Links

    Next

  • 1. list input randomizng
    First of all, thanks in advance for all advices... The problem is, at least I think, pretty simple to an experienced programer, but i'm a beginner... I have a list, and a base of 5 files(notepad) with strings in them(10 strings in a file, every one in a new line), and when I press a certain command button, i want strings to be loaded to the list(first time the first file, then the second.....). That's not complicated, and i know how to that, but i want those strings from a file to be added to the list randomly. an example; there a 3 strings("bla", "blabla","BlaBla") in a file and i want those to be added to the list with no specific order ("bla" can be the second or last.... you know what i mean).... I knowe i can randomize listindexes , but HOW TO APPLY RANDOM LIST INDEXES TO THE STRINGS SO THEIR ORDER OF ADDING TO THE LIST WOULD BE RANDOM?? Thanks for any help and advices...
  • 2. VB freezing upon trying to open a cash register drawer not connected to LPT1
    Hi, I have a VB application that is reuired to open a register drawer that is connected to en epson tm-822 printer, which, in turn, is connected to LPT1. When the printer and the drawer are connected there is no problem and everything works fine. However, there are some cases when the printer is not connected (i.e, remote site). In such case once VB executes the code lines responsible for opening the drawer, the application freezes, which forces me to kill V VB instance through the task manager. I think I have an idea what needs to be done, and if I'm right, then I don't know how to do it. To be more specific, I think I need to check whether the printer and/or the drawer is connected. If the printer is connected, I just execute the code responsible for opening the register. If it's not connected, then I skip the process of opening the register. In short, it all boils down to figuring out whether LPT1 port is connected to the printer. Does anyone have any idea what exactly I have to do. I came across port32.dll or winsock.dll, and if that may do the trick for me, then I would be greatly appreciative if someone pointed to me how to employ either one of those dll. The following is the code that opens the drawer. Open "LPT1" For Output As #1 Print #1, Chr(27) & Chr(112) & Chr(0) & Chr(25) & Chr(250) Close #1 Thank You In advance Avi
  • 3. DragDrop Listbox item
    Can I drag and drop a listbox-item in stead of dragging the whole listbox ? Hans Eekels (NL)
  • 4. Managing with VB Excel forms and textboxes created with the application
    Thanks in advanced to everyone who read this message. I've got a doubt of VBA. I don't know how to refer to a textbox created with Excel from the main application (out of VBA environment). The name of the textbox is "Elipse 21" and VBA doesn't understand this name. Anyone knows the collection that these textboxes belongs to? I've got to make an automatization of excel files, and I can't shift this problem. Thanks.
  • 5. Command Button Question
    Is there any way to make a command button appear Flat. instead of been Raised. Im using VB6 Ian

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 59 guest