这是UWP项目的一部分,该项目用于使用我基于GOD库创建的GoogleDrive / OneDrive / DropBox功能进行多次保存/打开对话框。
尝试将其放入cpp文件:
std::wstring OpenFileX = LR"(<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Orientation="Vertical">
<StackPanel Orientation="Vertical" x:Name="run" Visibility="Collapsed">
<ProgressRing x:Name="runProgress" IsActive="true" Margin="10" />
<ProgressBar x:Name="runBar" Value="0" Maximum="100" Margin="10"/>
<Button x:Name="runCancel" Margin="10">Cancel</Button>
</StackPanel>
<Pivot x:Name="pi">
<PivotItem Header="Local">
<StackPanel Orientation="Vertical" Margin="30">
<StackPanel Orientation="Horizontal">
<TextBox x:Name="localFile"
PlaceholderText="Filename"
Width="300" HorizontalAlignment="Left"/>
<Button x:Name="localPick" Margin="10,0,0,0" Width="50">...</Button>
</StackPanel>
<Button x:Name="localSave" Margin="0,20,0,0">Open</Button>
</StackPanel>
</PivotItem>
<PivotItem Header="Google Drive" x:Name="name_google">
<StackPanel Orientation="Vertical" Margin="30">
<ProgressRing x:Name="googleProgress" IsActive="true" />
<StackPanel Orientation="Horizontal" Visibility="Collapsed" x:Name="sp1">
<TextBox x:Name="googleFile"
PlaceholderText="Filename"
Width="300" HorizontalAlignment="Left"/>
<Button x:Name="googleSave" Margin="10,0,0,0" >Open</Button>
<Button x:Name="googleTop" Margin="10,0,0,0" >Top</Button>
</StackPanel>
<Grid Margin="0,20,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" x:Name="ColDef1" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" x:Name="RowDef1" />
</Grid.RowDefinitions>
<ListView Grid.Row="0" Grid.Column="0" CanDragItems="True" x:Name="googleList" SelectionMode="Extended" ScrollViewer.VerticalScrollBarVisibility="Visible" />
</Grid>
</StackPanel>
</PivotItem>
<PivotItem Header="OneDrive" x:Name="name_one">
<StackPanel Orientation="Vertical" Margin="30">
<ProgressRing x:Name="oneProgress" IsActive="true" />
<StackPanel Orientation="Horizontal" Visibility="Collapsed" x:Name="sp2">
<TextBox x:Name="oneFile"
PlaceholderText="Filename"
Width="300" HorizontalAlignment="Left"/>
<Button x:Name="oneSave" Margin="10,0,0,0" >Open</Button>
<Button x:Name="oneTop" Margin="10,0,0,0" >Top</Button>
</StackPanel>
<Grid Margin="0,20,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" x:Name="ColDef2" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" x:Name="RowDef2" />
</Grid.RowDefinitions>
<ListView Grid.Row="0" Grid.Column="0" CanDragItems="True" x:Name="oneList" SelectionMode="Extended" ScrollViewer.VerticalScrollBarVisibility="Visible" />
</Grid>
</StackPanel>
</PivotItem>
<PivotItem Header="DropBox" x:Name="name_db">
</PivotItem>
</Pivot>
</StackPanel>
)";
然后,Vs完全混乱。按F10键以WinMain开头会在WinMain前显示大约10行代码。
这是已知的Visual Studio错误吗?在VS 2019中进行了尝试。