QuerySongs in C++, how to use the IDispatch result?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: QuerySongs in C++, how to use the IDispatch result?

Re: QuerySongs in C++, how to use the IDispatch result?

by dplummer » Thu Jun 14, 2018 12:50 pm

I know this question is from way in the past but did you ever get to a solution?

I am in exactly the same place and having difficulty believing that getting a SongIterator object from the IDispatch result requires as much code as the MS manual pages seem to imply.

Please do share any solution or wisdom that you found

Regards

Dave

Re: QuerySongs in C++, how to use the IDispatch result?

by ebfe » Tue Mar 10, 2009 4:20 pm

bump?

QuerySongs in C++, how to use the IDispatch result?

by ebfe » Tue Mar 03, 2009 7:02 pm

So I got up to Querying the DB with QuerySong, which work, but after that I don't know how to use the IDispatch returned by QuerySong,

I have tried to cast it to a SongIterator which is what it should return, but using it cause access violation.

Code:

Code: Select all

			
ISDBSongIterator* AllSongs = NULL;

IDispatch *iter;
iSDBApp->get_Database(&iSDBDatabase);
hRes = iSDBDatabase->QuerySongs(L"ID > 0",&iter);

if(hRes == S_OK)
{
	VARIANT_BOOL eof;
	hRes = ((ISDBSongIterator*)AllSongs)->get_EOF(&eof); //FAIL
}

if(hRes == S_OK)	
	ISDBSongData *song;
	hRes = ((ISDBSongIterator*)AllSongs)->get_Item(&song); //FAIL
}	
So i guess I cannot just cast IDispatch to ISDBSongIterator* as I did..

Can anyone help?

Btw, I am making a C++ Bridge to Sync iTunes & MediaMonkey Database

Top