This example shows what a call to RegisterDynamicSource looks like. Refer to ISystemDebugEventInstall Example (Visual J++) to see the constant declarations and object creation code, as well as to see this code in a form you can run with minor modifications.
// Register the dynamic component we checked for above.
// SAMPLE_DYNAMIC_SOURCE_GUID is defined above; substitute the GUID for
// your dynamic component.
// If the dynamic component is a COM object that you want VSA to start
// automatically, provide its CLSID (CLSID_SAMPLE_DYNAMIC_SOURCE).
// Also specify whether the COM object should be started in process (true
// or false). Note that dynamic components should usually be created
// out-of-process so that if they crash, Visual Studio Analyzer will not
// be affected.
private static void SampleRegisterDynamicSource()
{
m_ESA.RegisterDynamicSource( "Sample Dynamic Event Source",
SAMPLE_DYNAMIC_SOURCE_GUID, "A sample dynamic event source",
CLSID_SAMPLE_DYNAMIC_SOURCE, 1 );
}