File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
vsix/ProjectTemplates/VC/Windows Universal/StaticLibrary Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 55This project demonstrates how to get started authoring Windows Runtime
66classes directly with standard C++, using the C++/WinRT SDK component
77to generate implementation headers from interface (IDL) files. The
8- generated Windows Runtime component binary and WinMD files should then
9- be bundled with the Universal Windows Platform (UWP) app consuming them.
8+ generated static library should be consumed by a single Runtime Component
9+ or App project and the and types will automatically be added to that
10+ binary.
11+ To be able to instantiate types from the static library you need to
12+ update the activation factory in the consuming binary to call the
13+ activation factory exposed by this static library using code similar to:
14+
15+ void* __stdcall $projectname$_get_activation_factory(
16+ std::wstring_view const& name);
17+
18+ void* __stdcall winrt_get_activation_factory(
19+ std::wstring_view const& name)
20+ {
21+ void* factory = $projectname$_get_activation_factory(name);
22+ if (factory)
23+ {
24+ return factory;
25+ }
26+
27+ /* call other activation factories */
28+
29+ return nullptr;
30+ }
1031
1132Steps:
12331. Create an interface (IDL) file to define your Windows Runtime class,
You can’t perform that action at this time.
0 commit comments