Please enable JavaScript to view this site.

Thread Validator Help

Navigation: The User Interface > Settings > Global Settings > General

CoInitializeEx

Scroll Prev Top Next More

The CoInitializeEx tab allows you to set the default behaviour used to initialize COM if Thread Validator needs to initialize COM to acquire symbols for .Net modules.

 

The default settings are shown below:

 

 coinitialize-settings-dialog

 

 

CoInitializeEx

 

In some situations the Validator needs to get .Net symbols and to do that COM needs to be initialized. This normally isn't a problem, but if your program also performs COM initialization and the sequence of events results in your COM initialization coming after the Validator's COM initialisation rather than getting the expected ERROR_SUCCESS return code you'll get either ERROR_INVALID_FUNCTION or RPC_E_CHANGED_MODE.

 

If you get ERROR_INVALID_FUNCTION this is OK, this just means you've called CoInitialize() or CoInitializeEx() multiple times with the same flags. Your code needs to handle ERROR_INVALID_FUNCTION as not an error.
 
If you get RPC_E_CHANGED_MODE this means you need to change the Validator's default value to the same value your program is using. That's what this dialog allows you to do.

 

If you also wish to disable OLE DDE or favour speed rather than memory use we've provided appropriate options for you to select to add those flags to the threading mode.

 

See the Microsoft documentation for additional information on the behaviour of CoInitialize() and CoInitializeEx().

 

 

Runtime detection of CoInitializeEx conflict

 

When the above scenario happens, that the Validator has initialized COM before your code initializes COM and your call returns RPC_E_CHANGED_MODE, we display a dialog to warn you about this failure and provide you with the option of editing the default value for subsequent runs of your application.

 

 coinitializeex-warning-dialog

 

 

Edit Settings... instructionStep opens the CoInitializeEx dialog shown above

 

 

Reset All - Resets all global settings, not just those on the current page.

 

 

Reset - Resets the settings on the current page.