Media player and WMA in VB6

Visual Basic

    Sponsored Links

    Next

  • 1. Vector graphics in VB6
    Another thing I should start to do in this vacation period is to build up some basic vector graphics facilities for plotting points, lines, curves (several very short lines), triangle fills, contours, 3D surfaces, etc. in VB6. Could someone tell me a good format which can easily be included in MS Office as well as OpenOffice documents? For example, PostScript is a good format, but cannot be introduced into Word or PowerPoint easily. I have no idea about wmf and other possible formats. So far I have plotted graphs on Forms or PictureBoxes and then SavePictured them into bitmaps, which is not very efficient or clean. These do not produce pictures in 300 dpi or higher resolution, which most journals and magazines would like to have. Is there some basic open source infrastructure in VB6 for simple vector graphics? With kind regards, A. Bulsari
  • 2. ODBC: Invalid argument
    Hi, I am using VB6 to open ms access database via ODBC, my DSN is "Local" using password (have set inside DSN). My code is: strConn = "ODBC;DATABASE=;UID=;PWD=;DSN=Local" Set wrk = CreateWorkspace("NewODBCWrk", "admin", "", dbUseODBC) ' Set con = wrk.OpenConnection("", dbDriverNoPrompt + dbRunAsync, False, strConn) Set rst = con.OpenRecordset("tblNumbers", dbOpenDynamic, 0, dbOptimisticBatch) when I run this code I got an error "Invalid argument" and stop at "openrecordset" my project-references are: visual basic for application visual basic runtime object and procedure visual basic object and procedure ole automation microsoft data binding collecton microsoft DAO 3.6 object library mu access database is ms access 2000 format How to solve this problem? I got stuck on this, have searched on the net and followed the advises but still got an error. TIA Yanto
  • 3. VB 6.0 and Paradox
    Hi: I'm building a program with VB 6.0 and have to connect to various Paradox tables (they are part of another program from which I have to get data and to which I have to write some data). I am also using Access 2000 for some of the data "manipulation". Anyway, two of the Paradox tables have over 1,000,000 records. When I try to do an rst.movelast, rst.movefirst in one of the Paradox tables, the program "dies"... when I try to do an rst.addnew on the Paradox the same thing happens. I tried setting the recordset then assigning the index (i.e., TripRst.Index = "PrimaryIndex") but I get an error that it is not supported. I opened the table in Access and looked at the Primary Index and it is Event#PX; so I tried TripRst.Index = Event#PX and also get an error. How can I speed up the "addnew" process? I need to add a new record to the end of the tables, but can't get there without unacceptable delays. Any assistance would be appreciated. Joe-Paul
  • 4. Keeping 2 listboxes in sync - VB6
    Hi All Hope I explain this OK! Basically I've got one listbox (incorporating checkboxes) that overlaps another so that the following display is shown: [ ] [ ] Cats [ ] [ ] Dogs [ ] [ ] Horses [ ] [ ] Sheep etc... etc.. The reason for this is so that the user can use the 1st column of checkboxes to include particular people and the 2nd one to exclude them. To try and keep both listboxes in sync when the user uses the top listbox's scrollbar to go up and down I use the following code: Private Sub lsbInitMenuList_Scroll(Index As Integer) lsbInitMenuList(0).TopIndex = lsbInitMenuList(1).TopIndex End Sub Now I originally tested this on 3 x WinXP machines and it works fine, but I've run it on a couple more XP machines and Vista machines and the scrollbar scrolling makes the list go wappie! The underneath listbox doesn't seem to move as the top listbox starts to go down and then the app seems to catch up to put them back into sync. Having tried it on a Vista machine a few minutes go the listboxes do eventually line up again, but the wappie-ness of the entries go up-and-down and out of sync looks pants and unprofessional. Is there anyway I can make this smoother?? Thanks

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