@@ -40,12 +40,9 @@ To complete this guide, make sure you have:
40
40
Learn more about the [ CloudSpatialAnchorSession] ( https://docs.microsoft.com/cpp/api/spatial-anchors/winrt/cloudspatialanchorsession ) class.
41
41
42
42
``` cpp
43
- SpatialAnchorsFactory m_asafactory{ nullptr };
44
43
CloudSpatialAnchorSession m_cloudSession{ nullptr };
45
- winrt::com_ptr<::IUnknown> unk;
46
- winrt::check_hresult(ASACreateFactory(unk.put()));
47
- m_asafactory = unk.as<SpatialAnchorsFactory >();
48
- m_cloudSession = m_asafactory.CreateCloudSpatialAnchorSession();
44
+
45
+ m_cloudSession = CloudSpatialAnchorSession();
49
46
```
50
47
51
48
[!INCLUDE [Account Keys](../../../includes/spatial-anchors-create-locate-anchors-account-keys.md)]
@@ -173,7 +170,7 @@ Learn more about the [CloudSpatialAnchor](https://docs.microsoft.com/cpp/api/spa
173
170
// If the user is placing some application content in their environment,
174
171
// you might show content at this anchor for a while, then save when
175
172
// the user confirms placement.
176
- CloudSpatialAnchor cloudAnchor = m_asafactory.CreateCloudSpatialAnchor ();
173
+ CloudSpatialAnchor cloudAnchor = CloudSpatialAnchor ();
177
174
cloudAnchor.LocalAnchor(localAnchor);
178
175
co_await m_cloudSession.CreateAnchorAsync(cloudAnchor);
179
176
m_feedback = LR"(Created a cloud anchor with ID=)" + cloudAnchor.Identifier();
@@ -194,7 +191,7 @@ Learn more about the [GetSessionStatusAsync](https://docs.microsoft.com/cpp/api/
194
191
Learn more about the [ AppProperties] ( https://docs.microsoft.com/cpp/api/spatial-anchors/winrt/cloudspatialanchor#appproperties ) method.
195
192
196
193
``` cpp
197
- CloudSpatialAnchor cloudAnchor = m_asafactory.CreateCloudSpatialAnchor ();
194
+ CloudSpatialAnchor cloudAnchor = CloudSpatialAnchor ();
198
195
cloudAnchor.LocalAnchor(localAnchor);
199
196
auto properties = m_cloudAnchor.AppProperties();
200
197
properties.Insert(LR"( model-type)" , LR"( frame)" );
0 commit comments