chrissi099 Posted July 1, 2007 Posted July 1, 2007 I was looking for some Examples, using dvbviewers COM interface with Borland C-Builder, nothing found. So here is a small sample source for next beginners (reading timers form DVBViewer) void __fastcall TfrmMain::FillTimerBoxCOM( void ) { Variant V; Variant TimerCollection; Variant tiv; int Count; AnsiString buf; int i,j; TimerEntry * te; // simple defined structure, you will find it out ;-) TDateTime tm; bool btmp; TListItem *litem; ClearTimerList(); LogText2File( " Read Timers from DVBViewer:" ); // simple logging function of main program try { V = Variant::GetActiveObject("DVBViewerServer.DVBViewer"); } catch(...){ LogText2File( " DVBViewer not found" ); return; } TimerCollection = V.OlePropertyGet("TimerManager"); Count = TimerCollection.OlePropertyGet( "Count" ); for ( i=0; i<Count; i++ ) { tiv = TimerCollection.OlePropertyGet( "Item", i ); te = new TimerEntry; FTimerList->Add( te ); buf = tiv.OlePropertyGet( "Description" ); te->Titel = buf; buf = tiv.OlePropertyGet( "ChannelName" ); te->Sender = buf; btmp = tiv.OlePropertyGet( "Recording" ); te->isRecording = btmp; btmp = tiv.OlePropertyGet( "Executeable" ); te->TimerError = !btmp; tm = (double)tiv.OlePropertyGet( "Date" ); te->Datum = tm; tm = (double)tiv.OlePropertyGet( "StartTime" ); te->Start = tm+te->Datum; tm = (double)tiv.OlePropertyGet( "EndTime" ); te->End = tm+te->Datum; if (( (double)te->End - (double)te->Start ) < 0.0 ) te->End += 1.0; } } HTH Greetings, Christian Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.