View Single Post
  #1 (permalink)  
Old 22nd December 2005
AlexR1973 AlexR1973 is offline
Junior Member
BS.Player Newbie
 
Join Date: Dec 2005
Posts: 3
Rep Power: 0
AlexR1973 is an unknown quantity at this point
Default BSPlayer crushes when get the requsts from another program

Hi guys!
I wrote a simple plugin for LCD Smartie that shows some information from BSPlayer on LCD/VFD screen. When BSPLayer stared first everything is OK. But when LCD Smartie started first and sends messages to BSPlayer during startup - BSPlayer crushes every time. What I am doing wrong and how I can avoid these crushes? Please take a look at the code:
Code:
extern "C" DLLEXPORT char * __stdcall function2(char *param1, char *param2)
{ 
    static char outbuf[100];

	HWND bsp_hand; 
	if ( (bsp_hand = FindWindow("BSPlayer",NULL)) !=0 )
	{ 
		int iStatus = SendMessage(bsp_hand,WM_BSP_CMD, BSP_GetStatus, 0);
		switch (iStatus)
		{
		case 0:
			sprintf (outbuf, "Stopped");
			break;
		case 1:
			sprintf (outbuf, "Paused");
			break;
		case 2:
			sprintf (outbuf, "Playing");
			break;
		case 4:
			sprintf (outbuf, "No movie open");
			break;
		}
	}
	else
	{
		strcpy (outbuf, "BSPlayer is not running.");
	}
	return outbuf;
}
Reply With Quote
 

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