Official BS.Player forums  

Go Back   Official BS.Player forums > Main forum > General Talk And Support

General Talk And Support General talk and peer-to-peer support about BS.Player and other video and audio multimedia players.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11th August 2006
Junior Member
BS.Player Newbie
 
Join Date: Aug 2006
Posts: 2
Rep Power: 0
Grimster is an unknown quantity at this point
Default API/SDK With C# -> OpenFile ?

Hi,

I'm trying to use the BSPlayer API with C#, I can get everything working.. but i'm stuck on the OpenFile method.

I can't get the cds.lpData part right with the address of the filename.

Does anybody allready know the anwser? I tried searching, and found the same problem... but no answer.

Thanx,

Grim
Reply With Quote
  #2 (permalink)  
Old 22nd August 2006
Moderator
BS.Player Master
 
Join Date: Nov 2003
Location: Italy
Posts: 3,037
Rep Power: 27
Tizio will become famous soon enough
Default

Since I don't think you mean to create a plugin for BSplayer v0.8x but instead you want to create a plugin for v1.00+ you can try to use this simpler command:
SendMessage(bsp_hand,WM_BSP_CMD,BSP_OpenFile,"File Name");
__________________
BSP SkinMaker (v1.07) the one and only Skin Editor for BSplayer
BSP Definitions Manager (v1.02)
BS.Player's FAQ (by BSPeter) | Italian language file (v2.57 build 1051)
Reply With Quote
  #3 (permalink)  
Old 22nd August 2006
Junior Member
BS.Player Newbie
 
Join Date: Aug 2006
Posts: 2
Rep Power: 0
Grimster is an unknown quantity at this point
Default Didn't do the trick

Hi thanks for replying,

Don't know why I didn't try it like that, but when I use the given command BSPlayer crashes. Doesn't bsplayer expect a COPYDATASTRUCT as the object instead of the Filename string?
Reply With Quote
  #4 (permalink)  
Old 22nd August 2006
Moderator
BS.Player Master
 
Join Date: Nov 2003
Location: Italy
Posts: 3,037
Rep Power: 27
Tizio will become famous soon enough
Default

Hi, I tried to use that command with VisualBasic and I had an error message too :?
Probably I really lack of programming knowledge if I'm not able to make it work that way if I don't use C++...

This is the WORKING routine that I use with VB, I hope you'll find it useful (lines starting with ' are comments):
Code:
Public Sub BSPOpenFile(FileName As String)
    Dim cds As COPYDATASTRUCT
    
    'Find BSplayer window's handle
    bsp_hand = FindWindow("BSPlayer", 0&)
    'If BSplayer is running -> window found
    If bsp_hand <> 0 Then
            
        'Set OpenFile as action
        cds.dwData = BSP_OpenFile
        'Create and set the pointer to the file name string
        '(VB doesn't provide pointers like C does)
        cds.lpData = lstrcpy(FileName, FileName)
        'Set the string lenght
        cds.cbData = Len(FileName) + 1
        
        'Open the selected file
        ReturnCode = SendMessage(bsp_hand, WM_COPYDATA, 0&, cds)
        
    End If
End Sub
EDIT:
Almost forgot, if you use WM_BSP_CMD instead of WM_COPYDATA in the send message call BSplayer knows that you are sending a command and not a copydatastruct
__________________
BSP SkinMaker (v1.07) the one and only Skin Editor for BSplayer
BSP Definitions Manager (v1.02)
BS.Player's FAQ (by BSPeter) | Italian language file (v2.57 build 1051)
Reply With Quote
Reply

Tags
>, api or sdk, openfile

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules


All times are GMT +1. The time now is 07:47 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