22nd December 2005
|
Junior Member BS.Player Newbie | | Join Date: Dec 2005
Posts: 3
Rep Power: 0 | |
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;
} |