快速登录:  

Forum: VirtualDJ Plugins

话题: The TVdjQueryResult structure seems to be deprecated in VDJ8

由于该帖子已年深日久,可能包含陈旧过时或描述错误的信息。

Hello,

I'm trying to query the artist and title of the current song playing. I've successfully got a plugin working, but the functions to retreive the info do not work.

The examples I've seen use a TVdjQueryResult structure, but this seems to be deprecated. I've tried this, but it does not seem to work:

char author[256];
char title[256];
char qRes[256];
HRESULT hr = GetStringInfo ("get loaded_song 'author'", &qRes[0], sizeof (qRes));
if (hr == S_OK) {
MultiByteToWideChar( CP_UTF8, 0, qRes, strlen(qRes) + 1, artist, sizeof (artist));
}
hr = GetStringInfo ("get loaded_song 'title'", &qRes[0], sizeof (qRes));
if (hr == S_OK) {
MultiByteToWideChar( CP_UTF8, 0, qRes, strlen(qRes) + 1, title, sizeof (title));
}

Apparently I'm not doing it right. How should it be done?

Thanks,
Peter
 

发表时间 Thu 27 Aug 20 @ 4:50 pm
Never mind. GetStringInfo is working just fine. The problem was MultiByteToWideChar. I don't need to use that at all. The text returned by GetStringInfo is already UTF-8 which is what I need for my application. All is good!
 

发表时间 Thu 27 Aug 20 @ 5:45 pm


(陈旧帖子或论坛版块会自动关闭)