[This is preliminary documentation and subject to change.]
Before your control can program Microsoft® WebTV® for Windows® or receive events from it, your control must connect to WebTV for Windows. It does so by calling the GetActiveObject Automation function.
Typically, a control calls GetActiveObject during its initialization. Connecting to WebTV for Windows when the control first starts ensures that the control has a connection before it tries to access WebTV for Windows. Obtaining a connection before you access WebTV for Windows is important because if a connection cannot be obtained, attempting to call the methods of ITVViewer will return an error. For example if your control cannot connect to WebTV for Windows, because WebTV for Windows is not currently running, the control can gracefully exit or otherwise handle the error.
For a detailed description of how to connect to WebTV for Windows, see Getting a Pointer to WebTV for Windows. To locate more information about GetActiveObject, see Further Information on Development Tasks in Broadcast Architecture.