VSARegisterSource Example

   Applies To

This example shows what a call to VSARegisterSource looks like. Refer to VsaRpcl Example to see the constant declarations and to see this code in a form you can run with minor modifications.

// Register the component we checked for in preceding code.
// str_SAMPLE_SOURCE_GUID is defined in preceding code; substitute the 
// GUID for your component. Assign a name for the component 
// (Sample Event Source) using Unicode characters.
static void RpcSampleRegisterSource()
{
   RpcTryExcept
   {
      VSARegisterSource( L"Sample Event Source", str_SAMPLE_SOURCE_GUID );  
   }
   RpcExcept(1)
   {
      LastErrorCode = RpcExceptionCode();
   }
   RpcEndExcept;
}