can anybody get this to work?
-downloaded the MSWMPSDK10 and wanted to try for a simple example. This sample intends to merely gain an interface to the already running Media Player and output the currently playing song Title and Artist.
The assumptions are that the Media Player is running, and playing a song.
No MFC, or ATL...
(understandably this is not a professional approach but for messing around in the garage it should be a fine example)
the problem I'm having is about linkage for the GUID:
int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
//query for WMP to get an interface to it
hr = Interface->QueryInterface(IID_IWMPCore, (void**)&Interface);
//bailout if it doesn't happen
if(hr == E_NOINTERFACE)
//add our reference to the interface
hr = Interface->AddRef();
//hope this is not the first reference only!
//the player should've been running already
if(hr > 1)
char author = "Author";
char lang = "en-us";
//get media interface
hr = Interface->get_currentMedia((IWMPMedia* *)&Media);
if(hr == S_OK)
hr = Media->get_name((USHORT**)&song);
//if(hr == S_OK)
hr = Media->getItemInfoByType((USHORT*)author, (USHORT*)lang, 0, &artist);
//if(hr == S_OK)
log.printf("Song: %s\n", song);
log.printf("Artist: %s\n", artist.bstrVal);
//don't know, maybe should crank up the player then
log.printf("fookd! -better quit screwin around...\n");
passiveTest.obj : error LNK2001: unresolved external symbol _IID_IWMPCore
I'm guessing it's something to do with the "wmp.idl". The samples from the SDK built w/o an issue, and I've set my built settings in the same manner, but then again this is a slightly different approach using the IID_IWMPCore GUID. None of the samples are using this.
I setup a separate project to try to built a .lib out of the .idl, but that didn't happen, I guess that's not what you do. I was thinking it would be no problem to add linkage for a wmp.lib to the project. This whole .idl issue was a problem anyway from the start because if you don't ALSO have the Internet Development SDK(yes, don't go to the msdn and try to search for the Internet Explorer SDK ; ) -then it won't work at all! Anyhow, after installing the IESDK, at least everything builds without a problem, but I can't get linkage for the GUID.