IScheduledItems::AddFromQuery

[This is preliminary documentation and subject to change.]

The AddFromQuery method schedules reminders for all the television shows in the result set of a DAO QueryDef query.

HRESULT AddFromQuery(
  BSTR  Workspace,      // in
  BSTR  QueryName,      // in
  BSTR  Application,    // in
  BSTR  Directory,      // in
  long  AdvanceMinutes, // in
  BSTR  Parameters,     // in
  VARIANT * pSafeArray  // out
);
 

Parameters

Workspace
Name of the DAO workspace. This workspace can be either preexisting or newly created.
QueryName
Name of the QueryDef definition. To create a QueryDef from a show reference, your application uses the ITelevisionServices::ResolveBroadcast method.
Application
Name and path of the application that displays the reminder to the user when the scheduled show is on. Typically, WebTV for Windows is used to display reminders, and this value is set to C:\Program Files\TV Viewer\Tvx.exe.

Your application can get the path to the broadcast client's installation of WebTV for Windows by calling ITelevisionServices::get_DatabaseFile and stripping Tss.mdb off the end of the returned string. This path is also stored in this registry entry:

HKLM\Software\Microsoft\TV Services\ProductDir

Directory
Name of the working directory that contains the reminder application.
AdvanceMinutes
Interval, in minutes, before the show's start that the reminder should occur.
Parameters
Additional command-line arguments for the application specified by the Application parameter. The format and number of these arguments depend on the application referred to by Application. Parameters is passed to Application as command-line arguments.

For example, if you are using a custom application to display the reminder to the user, and this application has three styles of reminder dialog boxes, Parameters could be used to specify the reminder style.

For a list of the parameters used with the WebTV for Windows reminder application, Tvx.exe, see the description of WebTVforWindowsParameters in Show Reminder Format.

pSafeArray
Pointer to a VARIANT that receives an IEnumVARIANT interface that enumerates the string indices of the scheduled show reminders. To locate more information on working with IEnumVARIANT, see Further Information on Television Services for the Client.

Return Values

Returns an HRESULT indicating success or failure. If the method succeeds, it returns S_OK. Otherwise, it returns an error code. For specific error codes, see the Winerror.h and Dbdaoerr.h header files. To locate more information about Winerror.h and Dbdaoerr.h, see Further Information on Television Services for the Client.

Remarks

The AddFromQuery method iterates through the result set of the defined query, composing a show reference for each row and scheduling a reminder for that show reference. Typically, you use the queries created by ITelevisionServices::ResolveBroadcast as the QueryName parameter for AddFromQuery.

Reminders set using AddFromQuery are not automatically visible in the WebTV for Windows user interface. In order for a TSS-set reminder to be visible in WebTV for Windows, it must meet certain standards. Setting a Reminder That Appears in WebTV for Windows specifies these standards.

To locate more information on the SAFEARRAY data type, see Further Information on Television Services for the Client.

QuickInfo

  Windows NT: Unsupported.
  Windows: Requires Windows 98.
  Windows CE: Unsupported.
  Header: Declared in tssadmin.odl.
  Import Library: Included as a resource in tssadmin.dll.
  Unicode: Yes.

See Also

IScheduledItems::Add, IScheduledItems::Remove, ITelevisionServices::ResolveBroadcast