inform-sega
12-19-2003, 10:50 PM
Hi all!
Does anybody know what's wrong with my work?
I tried to get current QCD song title from the external application (i.e. LiteStep), so
1) my app is .dll too
2) but it is LiteStep module, not QCD plugin
and I cannot understand why it does't work.
There is a part of my code:
HWND hwndQCD = FindWindow("PlayerCanvas",NULL);
if (hwndQCD)
{
char buf[1024];
PluginServiceFunc ServiceFunc = (PluginServiceFunc)SendMessage(hwndQCD, WM_GETSERVICEFUNC, PLUGIN_API_WANTUTF8, 0);
if (ServiceFunc) //Is it really QCD?
{
LSLogPrintf(LOG_DEBUG,"UniMedia Display","Before %ld",(long)ServiceFunc);
if (ServiceFunc(opGetTrackName,buf,1024,-1))
{
LSLogPrintf(LOG_DEBUG,"UniMedia Display","In1");
title = buf;
}
else
{
LSLogPrintf(LOG_DEBUG,"UniMedia Display","In2")
title = "Failure";
}
LSLogPrintf(LOG_DEBUG,"UniMedia Display","After");
wndWinamp = hwndQCD;
return;
}
}
I've got the 'normal' Service pointer (i.e. very small plugin shows the same address of this function), but I have only one string in log-file:
before ...
__Everything__ after call of Service function is missed :(
No exceptions, no errors, proccess execution continues in normal mode, but I havn't 'after' and in1'' or 'in2' lines in logfile.
If I uses the same code in my plug-in - everything works fine.
Does it mean that Service procedure can be called only from libraries, executed with the same hInstance, or there is another way to implement my request (get song title from the external app)?
Help me, please.
Does anybody know what's wrong with my work?
I tried to get current QCD song title from the external application (i.e. LiteStep), so
1) my app is .dll too
2) but it is LiteStep module, not QCD plugin
and I cannot understand why it does't work.
There is a part of my code:
HWND hwndQCD = FindWindow("PlayerCanvas",NULL);
if (hwndQCD)
{
char buf[1024];
PluginServiceFunc ServiceFunc = (PluginServiceFunc)SendMessage(hwndQCD, WM_GETSERVICEFUNC, PLUGIN_API_WANTUTF8, 0);
if (ServiceFunc) //Is it really QCD?
{
LSLogPrintf(LOG_DEBUG,"UniMedia Display","Before %ld",(long)ServiceFunc);
if (ServiceFunc(opGetTrackName,buf,1024,-1))
{
LSLogPrintf(LOG_DEBUG,"UniMedia Display","In1");
title = buf;
}
else
{
LSLogPrintf(LOG_DEBUG,"UniMedia Display","In2")
title = "Failure";
}
LSLogPrintf(LOG_DEBUG,"UniMedia Display","After");
wndWinamp = hwndQCD;
return;
}
}
I've got the 'normal' Service pointer (i.e. very small plugin shows the same address of this function), but I have only one string in log-file:
before ...
__Everything__ after call of Service function is missed :(
No exceptions, no errors, proccess execution continues in normal mode, but I havn't 'after' and in1'' or 'in2' lines in logfile.
If I uses the same code in my plug-in - everything works fine.
Does it mean that Service procedure can be called only from libraries, executed with the same hInstance, or there is another way to implement my request (get song title from the external app)?
Help me, please.