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
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]
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
}
[/code]
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