Official BS.Player forums  

Go Back   Official BS.Player forums > Main forum > Bug Reports And Codecs

Bug Reports And Codecs Report BS.Player bugs here - help us to improve BS.Player even further.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 23rd September 2003
Junior Member
BS.Player Newbie
 
Join Date: Sep 2003
Posts: 2
Rep Power: 0
smorrowatwork is an unknown quantity at this point
Default API VB Troubles BSP_GetFilename

:?
I've had very good luck with the API from VB so far, but am stumped on using the BSP_GetFilename API Call. Below is my VB code with a description of the setup and results. Any assistance is solving this conundrum would be appreciated.

Setup:
Bsplayer Ver 0.86 Build 501 16 Sep 2003
Running and playing .avi file named "BetterOffDead.avi"

VB Code:

Dim cds As COPYDATASTRUCT
Dim sbuf As String

bsp_hand = FindWindow("BSPlayer", vbNullString)

'Get filename
sbuf = String$(MAX_PATH, vbNullChar)
cds.dwData = BSP_GetFileName
cds.lpData = VarPtr(sbuf)
cds.cbData = 4
SendMessage bsp_hand, WM_COPYDATA, Me.hwnd, cds

Output:

sbuf = "????????????????" with the remainder of the buffer filled with the null character.

This tells me that the message to BSPlayer is being recieved, and the buffer is being modified, but the result back is all '?' and not the name of the file. By the way there is 1 too few '?' for 'BetterOffDead.avi'. I was thinking there might be Unicode vs ASCII characters issue.

I'm stumped.

-Steven
Reply With Quote
  #2 (permalink)  
Old 24th September 2003
Senior Member
BS.Player Power User
 
Join Date: Jun 2002
Location: Greece
Posts: 115
Rep Power: 0
HackerWerger is an unknown quantity at this point
Default

smorrowatwork, did you manage to find out how to get bsplayer's version using api?
Reply With Quote
  #3 (permalink)  
Old 24th September 2003
Junior Member
BS.Player Newbie
 
Join Date: Sep 2003
Posts: 2
Rep Power: 0
smorrowatwork is an unknown quantity at this point
Default

Yes, and it works.

According to the API the return value is the version number.

// BSPlayer API v 1.0
//
// To get BSPlayer window handle use:
// bsp_hand = FindWindow("BSPlayer",vbNullString)
//
// then you can send messages, for ex. to get current version:
// bsp_ver = SendMessage(bsp_hand,WM_BSP_CMD,BSP_GETVERSION,0)

' Return player version
' format will be XX.YY.ZZZZ -> &HXXYYZZZZ
' for 0.84.484 -> &H00840484

However the BSP_GetFilename message uses a pointer to a buffer to contain the filename. The buffer gets filled with a few '?' instead of the filename.

-smorrowatwork
Reply With Quote
Reply

Tags
api, bspgetfilename, troubles

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules


All times are GMT +1. The time now is 09:54 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
Ad Management plugin by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20