Skip to content

Commit

Permalink
Windows 10 Version 2004 - March 2022 Samples Update
Browse files Browse the repository at this point in the history
* IoT-GPIO: Remember event token so we can unsubscribe later #1247
* SimpleCommunication: Fix typo in parameter ordering (code worked, but names were backward) #1294
* WiFiDirect: Fix build #1319
* Delete obsolete samples templates
  • Loading branch information
oldnewthing committed Mar 10, 2022
1 parent f7bec16 commit 7ea34b4
Show file tree
Hide file tree
Showing 27 changed files with 29 additions and 721 deletions.
2 changes: 1 addition & 1 deletion Samples/IoT-GPIO/cppwinrt/Scenario2_Listen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace winrt::SDKTemplate::implementation

// Configure pin for input and add ValueChanged listener.
listenPin.SetDriveMode(GpioPinDriveMode::Input);
listenPin.ValueChanged({ get_weak(), &Scenario2_Listen::Pin_ValueChanged });
valueChangedEventToken = listenPin.ValueChanged({ get_weak(), &Scenario2_Listen::Pin_ValueChanged });

// Start toggling the pin value every 500ms.
timer = DispatcherTimer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ namespace Microsoft { namespace Samples { namespace SimpleCommunication {
Windows::Media::IMediaExtension ^GetMFExtensions();

Windows::Foundation::IAsyncOperation<Windows::Media::IMediaExtension^>^ InitializeAsync(
Windows::Media::MediaProperties::IMediaEncodingProperties ^videoEncodingProperties,
Windows::Media::MediaProperties::IMediaEncodingProperties ^audioEncodingProperties
Windows::Media::MediaProperties::IMediaEncodingProperties ^audioEncodingProperties,
Windows::Media::MediaProperties::IMediaEncodingProperties ^videoEncodingProperties
);

event Windows::Foundation::EventHandler<Object^>^ IncomingConnectionEvent;
Expand Down
9 changes: 6 additions & 3 deletions Samples/WiFiDirect/cs/WiFiDirect.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,18 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConnectionSettingsPanel.xaml">
<Page Include="..\shared\ConnectionSettingsPanel.xaml">
<Link>ConnectionSettingsPanel.xaml</Link>
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Scenario1_Advertiser.xaml">
<Page Include="..\shared\Scenario1_Advertiser.xaml">
<Link>Scenario1_Advertiser.xaml</Link>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Scenario2_Connector.xaml">
<Page Include="..\shared\Scenario2_Connector.xaml">
<Link>Scenario2_Connector.xaml</Link>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
Expand Down
7 changes: 2 additions & 5 deletions SharedContent/Templates/InstallSDKTemplates.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ IF /I "%1"=="-UNINSTALL" GOTO Uninstall
call :directory "ProjectTemplates\Visual C#\Windows Universal" UWPSDKSampleCS Shared\Project\*
call :directory "ItemTemplates\Visual C#\Windows Universal" UWPSDKSampleScenarioItemCS Shared\Item\*

call :directory "ProjectTemplates\Visual C++ Project\Windows Universal" UWPSDKSampleCX Shared\Project\*
call :directory "ItemTemplates\Visual C++ Project\Windows Universal" UWPSDKSampleScenarioItemCX Shared\Item\*

call :directory "ProjectTemplates\Visual C++ Project\Windows Universal" UWPSDKSampleCPP Shared\Project\*
call :directory "ItemTemplates\Visual C++ Project\Windows Universal" UWPSDKSampleScenarioItemCPP Shared\Item\*

Expand Down Expand Up @@ -35,5 +32,5 @@ IF /I "%1"=="-UNINSTALL" GOTO Uninstall
rd /s/q "%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplates\Visual C++ Project\Windows Universal\UWPSDKSampleCX"
rd /s/q "%USERPROFILE%\Documents\Visual Studio 2019\Templates\ItemTemplates\Visual C++ Project\Windows Universal\UWPSDKSampleScenarioItemCX"

rd /s/q "%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplates\Visual C++ Project\Windows Universal\UWPSDKSampleCPPWINRT"
rd /s/q "%USERPROFILE%\Documents\Visual Studio 2019\Templates\ItemTemplates\Visual C++ Project\Windows Universal\UWPSDKSampleScenarioItemCPPWINRT"
rd /s/q "%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplates\Visual C++ Project\Windows Universal\UWPSDKSampleCPP"
rd /s/q "%USERPROFILE%\Documents\Visual Studio 2019\Templates\ItemTemplates\Visual C++ Project\Windows Universal\UWPSDKSampleScenarioItemCPP"
40 changes: 0 additions & 40 deletions SharedContent/Templates/UWPSDKSampleCPP/UWPSDKSampleCPP.sln

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup>
<SharedContentDir>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), LICENSE))\SharedContent</SharedContentDir>
</PropertyGroup>
Expand Down Expand Up @@ -175,5 +176,13 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</TemplateData>
<TemplateContent>
<Project File="UWPSDKSampleCPP.vcxproj" ReplaceParameters="true">
<ProjectItem ReplaceParameters="true" TargetFileName="packages.config">packages.config</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="pch.cpp">pch.cpp</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="pch.h">pch.h</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="Project.idl">Project.idl</ProjectItem>
Expand All @@ -31,6 +32,7 @@
<ProjectItem ReplaceParameters="true" TargetFileName="Scenario2_ShortName.cpp">Scenario2_ShortName.cpp</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="Scenario2_ShortName.h">Scenario2_ShortName.h</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="Package.appxmanifest">Package.appxmanifest</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="$projectname$.vcxproj">UWPSDKSampleCPP.vcxproj</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="$projectname$.vcxproj.filters">UWPSDKSampleCPP.vcxproj.filters</ProjectItem>
<ProjectItem ReplaceParameters="false" TargetFileName="README.md">README.md</ProjectItem>
</Project>
Expand All @@ -40,8 +42,10 @@
<FullClassName>NuGet.VisualStudio.TemplateWizard</FullClassName>
</WizardExtension>
<WizardData>
<!--
<packages repository="extension" repositoryId="Microsoft.Windows.CppWinRT">
<package id="Microsoft.Windows.CppWinRT" version="2.0.200615.7" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210922.5" />
</packages>
-->
</WizardData>
</VSTemplate>
4 changes: 4 additions & 0 deletions SharedContent/Templates/UWPSDKSampleCPP/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.210922.5" targetFramework="native" />
</packages>
53 changes: 0 additions & 53 deletions SharedContent/Templates/UWPSDKSampleCX/Package.appxmanifest

This file was deleted.

22 changes: 0 additions & 22 deletions SharedContent/Templates/UWPSDKSampleCX/SampleConfiguration.cpp

This file was deleted.

47 changes: 0 additions & 47 deletions SharedContent/Templates/UWPSDKSampleCX/SampleConfiguration.h

This file was deleted.

This file was deleted.

31 changes: 0 additions & 31 deletions SharedContent/Templates/UWPSDKSampleCX/Scenario1_ShortName.xaml.h

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7ea34b4

Please sign in to comment.