Official BS.Player forums

Official BS.Player forums (http://forum.bsplayer.com/)
-   General Talk And Support (http://forum.bsplayer.com/general-talk-support/)
-   -   BSP_OpenFile, Unicode and C++ (http://forum.bsplayer.com/general-talk-support/12356-bsp_openfile-unicode-c.html)

apophys 20th September 2011 04:57 PM

BSP_OpenFile, Unicode and C++
 
Hi guys,

Sorry if this has been posted on the forum, but I haven't found anything.

I'm developing an Android control app for bsplayer and I'm having trouble with BSP_OpenFile and unicode filenames. It works ok for ascii ones.

Here's the code I use:

int bsplayer_openFile(HWND bsp_hand, HWND bsremote_hwnd, bool fullscreen, wchar_t* filename)
{

COPYDATASTRUCT cds;

cds.dwData = BSP_OpenFile;
cds.lpData = (void *) filename;
// cds.cbData = (DWORD) strlen ((char *)cds.lpData)+1;
cds.cbData = (DWORD) (wcslen ((wchar_t *)cds.lpData))*sizeof(wchar_t)+2;

int result = SendMessage(bsp_hand, WM_COPYDATA, (WPARAM) bsremote_hwnd, (LPARAM)&cds);



}


BSplayer simply doesn't reacct, so probably I'm giving it data in the wrong format.

Could you help me with this?

apophys 20th September 2011 05:03 PM

Here's what filename I use for testing:

другие приключения Шурика.avi

apophys 22nd September 2011 07:25 PM

This works only for ASCII strings, not unicode:

int bsplayer_openFile(HWND bsp_hand, HWND bsremote_hwnd, bool fullscreen, wchar_t* filename)
{
char* fff = (char*) calloc(1000, 1);

size_t sizeRequired = WideCharToMultiByte( 950, 0, filename, -1, fff, 1000, NULL, NULL);

COPYDATASTRUCT cds;
cds.dwData = BSP_OpenFile;
cds.lpData = (void *) fff;
cds.cbData = (DWORD) sizeRequired +2;

int result = SendMessage(bsp_hand, WM_COPYDATA, (WPARAM) bsremote_hwnd, (LPARAM)&cds);

..

}

Tizio 24th September 2011 12:34 AM

I don't know if you actually need to forcedly call the SendMessageW function, but the problem can lay in BSplayer code.
Only a BSplayer member can reply to this last statement, as for my suggestion in using SendMessageW... I'm not sure, not coding in C since a lot of time and never dealt with unicode strings before, sorry

apophys 25th September 2011 07:47 PM

Quote:

Originally Posted by Tizio (Beitrag 46056)
I don't know if you actually need to forcedly call the SendMessageW function, but the problem can lay in BSplayer code.
Only a BSplayer member can reply to this last statement, as for my suggestion in using SendMessageW... I'm not sure, not coding in C since a lot of time and never dealt with unicode strings before, sorry

Thanks for the tip, I'll give it a shot. Though I think the problem is on the bsplayer side of things...

Ico-man 26th September 2011 02:22 PM

Support for BSP_OpenFileW will be added in next beta. Unicode should work then.

Tizio 2nd October 2011 03:33 PM

Thank you very much for this addition :wink:

apophys 2nd October 2011 05:49 PM

Quote:

Originally Posted by Ico-man (Beitrag 46100)
Support for BSP_OpenFileW will be added in next beta. Unicode should work then.

Thanks, looking forward to the next release :D

BSPeter 7th October 2011 09:17 PM

Next release (beta) just published: http://forum.bsplayer.com/news-updat...html#post46340!
:wink:

apophys 8th October 2011 02:50 PM

Quote:

Originally Posted by BSPeter (Beitrag 46352)
Next release (beta) just published: http://forum.bsplayer.com/news-updat...html#post46340!
:wink:

Sweet! I'll test it and get back to you.

Thanks!

apophys 8th November 2011 12:18 AM

Quote:

Originally Posted by apophys (Beitrag 46371)
Sweet! I'll test it and get back to you.

Thanks!

Hi guys!

I finally got around to implementing unicode in bsremote and it works like a charm. Thanks a lot for responding to the request so quickly!

When you have some more time on your hands :teeth:, could you also add support in the API for unicode subtitles? Nobody asked for that yet, but I assume it will be needed at some point.

Great work!


All times are GMT +1. The time now is 07:39 PM.

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