Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Sets and queries global properties of the Component Object Model (COM) runtime.
The IGlobalOptions interface inherits from the IUnknown interface. IGlobalOptions also has these types of members:
The IGlobalOptions interface has these methods.
IGlobalOptions::Query The IGlobalOptions::Query (objidlbase.h) method queries the specified global property of the COM runtime. |
IGlobalOptions::Set The IGlobalOptions::Set (objidlbase.h) method sets the specified global property of the COM runtime. |
The following global properties of the COM runtime can be set and queried with this interface.
Property | Values |
---|---|
COMGLB_APPID | The AppID for the process. This is the only supported property on Windows XP. |
COMGLB_EXCEPTION_HANDLING |
Possible values for the COMGLB_EXCEPTION_HANDLING property are:
Note Even if COM runtime exception handling is disabled, exceptions might not propagate to WER if there is another application-level exception handler in the process that handles the exception.
|
COMGLB_RPC_THREADPOOL_SETTING |
Possible values for the COMGLB_RPC_THREADPOOL_SETTING property in the Set method are:
The COMGLB_RPC_THREADPOOL_SETTING property can be used to change the RPC thread pool behavior. Changing the default behavior will incur a performance penalty since this causes RPC to use an extra thread. Therefore, care should be exercised when changing this setting. It is recommended that this setting is changed only for application compatibility reasons. Note This property must be set immediately after COM is initialized in the process. If this property is set after performing any operations that cause COM to initialize the RPC channel (for example, marshaling or unmarshalling object references), the Set method will fail.
|
COMGLB_RO_SETTINGS |
Possible values for the COMGLB_RO_SETTINGS property are:
|
COMGLB_UNMARSHALING_POLICY |
Possible values for the COMGLB_UNMARSHALING_POLICY property are:
|
It's important for applications that detect crashes and other exceptions that might be generated while executing inbound COM calls, for example a call on a local server or when executing the IDropTarget::Drop method, to set COMGLB_EXCEPTION_HANDLING to COMGLB_EXCEPTION_DONOT_HANDLE to disable COM behavior of catching exceptions. Failure to do this can lead to corrupt process state, for example locks held when these exceptions are thrown are abandoned, and the process could enter an inconsistent state.
All such applications should execute this code at startup.
IGlobalOptions *pGlobalOptions;
hr = CoCreateInstance(CLSID_GlobalOptions, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pGlobalOptions));
if (SUCCEEDED(hr))
{
hr = pGlobalOptions->Set(COMGLB_EXCEPTION_HANDLING, COMGLB_EXCEPTION_DONOT_HANDLE);
pGlobalOptions->Release();
}
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2003 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | objidlbase.h (include ObjIdl.h) |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today