A function template that creates a single uninitialized object of the class associated with a specified CLSID, and returns it as a winrt::com_ptr or an empty com_ptr if not successful.
Syntaxtemplate <typename Interface>
winrt::com_ptr<Interface> try_create_instance(guid const& clsid,
uint32_t context = 0x1 /*CLSCTX_INPROC_SERVER*/,
void* outer = nullptr);
Template parameters
typename Interface
The type of the interface pointer to query for on the newly created object.
clsid
The CLSID associated with the data and code that will be used to create the object.
context
Context in which the code that manages the newly created object will run. The values are taken from the enumeration CLSCTX.
outer
If nullptr
, indicates that the object is not being created as part of an aggregate. If not nullptr
, a pointer to the aggregate object's IUnknown interface (the controlling IUnknown).
A winrt::com_ptr of the newly created object or an empty com_ptr if not successful.
RequirementsMinimum supported SDK: Windows SDK version 10.0.17134.0 (Windows 10, version 1803)
Namespace: winrt
Header: %WindowsSdkDir%Include<WindowsTargetPlatformVersion>\cppwinrt\winrt\base.h (included by default)
See alsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4