#include "\JimsCode\CPP\MusicControler\StdAfx.h" #include "\JimsCode\CPP\MusicControler\MusicControler.h" #include "\JimsCode\CPP\MCDB\mcdb.h" void TestGetTOCForDisc(void) { HRESULT hr = S_OK; unsigned char *pstrTOC=NULL; CMCDB* cMCDB = new CMCDB(); hr =cMCDB->GetTOCForDisc((unsigned char*)"{6DF8D4DE-A36A-4B61-BA90-616AC1267E4C}", 1, &pstrTOC); printf("RC=%d\n",hr); if(MC_OK == hr) { printf("%s",pstrTOC); CoTaskMemFree(pstrTOC); } } void TestInsertDevice(void) { HRESULT hr = S_OK; CMCDB* cMCDB = new CMCDB(); hr =cMCDB->InsertDevice((unsigned char*)"Kenwood CD-425M", (unsigned char*)"A", (unsigned char*)"Kenwood", (unsigned char*)"COM1:"); printf("RC=%d\n",hr); } void TestInsertDisc1(void) { _bstr_t bstrMediaID; _bstr_t bstrMuiID; _bstr_t bstrTitle; _bstr_t bstrArtist; long lngYear; long lngLang; long lngGenre; _bstr_t bstrLabel; _bstr_t bstrTOC; HRESULT hr = S_OK; CMCDB* cMCDB = new CMCDB(); bstrTOC = _T("123123123123123123123123123123123123123123123"); bstrMediaID = _T("11111111111111111111111111111111111111111111"); bstrMuiID = _T("123123123123123123123"); bstrTitle = _T("A Test of the system"); bstrArtist = _T("Antoehr artist"); lngYear = 1; lngLang = 1; lngGenre = 1; bstrLabel = _T("asdasdasdasD"); hr =cMCDB->InsertDisc( bstrTOC, bstrMediaID, bstrMuiID, bstrTitle, bstrArtist, lngYear, lngGenre, lngLang, bstrLabel); printf("RC=%d\n",hr); } void TestInsertDisc2(void) { _bstr_t bstrMediaID; _bstr_t bstrMuiID; _bstr_t bstrTitle; _bstr_t bstrArtist; long lngYear; long lngLang; long lngGenre; _bstr_t bstrLabel; _bstr_t bstrTOC; HRESULT hr = S_OK; CMCDB* cMCDB = new CMCDB(); bstrTOC = _T("123123123123123123123123123123123123123123123"); bstrMediaID = _T("11111111111111111111111111111111111111111111"); bstrMuiID = _T("123123123123123123123"); bstrTitle = _T("A Test of 'the 'system"); bstrArtist = _T("Antoehr artist"); lngYear = 1; lngLang = 1; lngGenre = 1; bstrLabel = _T("asdasdasdasD"); hr =cMCDB->InsertDisc( bstrTOC, bstrMediaID, bstrMuiID, bstrTitle, bstrArtist, lngYear, lngGenre, lngLang, bstrLabel); printf("RC=%d\n",hr); } void TestDeleteAllDiscs(void) { HRESULT hr = S_OK; CMCDB* cMCDB = new CMCDB(); hr =cMCDB->DeleteAllDiscs(); printf("RC=%d\n",hr); } int main(int argc, char* argv[]) { HRESULT hr = S_OK; hr = CoInitialize(NULL) ; if(S_OK != hr) { //Are you sure this is a Win 32 platform??? In the year 2002??? printf("Failed CoInitError (??!?) =%3d\n",hr); return(-1); } // TestInsertDevice(); TestGetTOCForDisc(); TestInsertDisc1(); TestInsertDisc2(); TestInsertDisc1(); TestInsertDisc2(); TestInsertDisc1(); TestInsertDisc2(); TestInsertDisc1(); TestInsertDisc2(); TestInsertDisc1(); TestInsertDisc2(); TestInsertDisc1(); TestInsertDisc2(); TestInsertDisc1(); TestInsertDisc2(); TestInsertDisc1(); TestInsertDisc2(); TestInsertDisc1(); // TestDeleteAllDiscs(); CoUninitialize(); return(MC_OK); }