Microsoft KB Archive/243262

= PRB: Filters May Not Behave as Expected when Using cVSAEventStandard =

Article ID: 243262

Article Last Modified on 10/2/2003

-

APPLIES TO


 * Microsoft Visual Studio 6.0 Enterprise Edition

-



This article was previously published under Q243262



SYMPTOMS
When firing an event from your custom component that uses cVSAEventStandard as the dwFlags parameter, the event may not show up in the Visual Studio Analyzer Event list.



CAUSE
When passing cVSAEventStandard as the dwFlags parameter of the FireEvent method, no default values are set for the following parameters:
 * SourceComponent and TargetComponent
 * SourceMachine and TargetMachine
 * SourceProcess and TargetProcess
 * SourceSession and TargetSession
 * SourceThread and TargetThread

If a filter based on these parameters is used to view or record events, the filter will evaluate to false and no events will appear in the event list.



RESOLUTION
Provide default values for these parameters, or provide your own. You can provide default values for these parameters by passing cVSAEventDefaultTarget | cVSAEventDefaultSource as the dwFlags parameter of the FireEvent method.



STATUS
This behavior is by design.



MORE INFORMATION
Consider the following code fragment. The event is being fired from the MyProc.exe process. const int MAXPARAMS = 2;

DWORD rgTypes[ MAXPARAMS ] = {    //custom parameter whose value will be an ANSI string cVSAParameterKeyString | cVSAParameterValueANSIString, //standard parameter SourceMachine cVSAParameterValueANSIString };

DWORD rgKeys[ MAXPARAMS ] = {    //custom parameter name (DWORD) L"CustomParam", //SourceMachine cVSAStandardParameterSourceMachine };

DWORD rgValues[ MAXPARAMS ] = {    //value for CustomParam (DWORD) "This is a Custom Parameter", //value for SourceMachine (DWORD) "MyPc" };

if( S_OK == pIEventFire->IsActive ) {    //fire the custom event pIEventFire->FireEvent(MYPROC_EVENT_1,MAXPARAMS,rgKeys,rgValues,rgTypes,0, 0, cVSAEventStandard ); }

The following filter will evaluate to false as there is no default value set for SourceProcess: ( SourceProcess = "MyProc" )

The following filter will evaluate to true as you have explicitly provided your own value for SourceMachine:

( SourceMachine = "MyPc" )

Modifying the dwFlags parameter to generate default parameters will cause both filters to evaluate to true: pIEventFire->FireEvent(MYPROC_EVENT_1,MAXPARAMS,rgKeys,rgValues,rgTypes,0, 0, cVSAEventDefaultSource | cVSAEventDefaultTarget );

