locked
How can I add the Windows reference to a C++ Project?

    Question

  • Hi,
    I am trying to learn to do a game with directX 2D.
    The sample from Microsoft has in References a reference named Windows.
    Where can I find it to add to my project?
    Thanks

    ADRIAN DIBU

    Wednesday, April 09, 2014 12:52 PM

Answers

  • Hi,

    You use the source code from codeplex:

    http://fallfury.codeplex.com/

    I think if your have any problem about the project you should directly post your thread in the dissussion:

    http://fallfury.codeplex.com/documentation

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by adibu Friday, April 11, 2014 3:58 PM
    Friday, April 11, 2014 5:49 AM

All replies

  • what kind of project is the C++ project? if you make that a windows runtime compent you can link it as any other library.

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Wednesday, April 09, 2014 1:08 PM
  • Hi,

    Thanks for the prompt answer.

    What I did:
    C++ --> Windows Store --> DirectX App (XMAL) Main Project
    and
    I added a reference c#
    c# --> Windows Store --> Windows Runtime Component

    I am in VS 2013 and
    I am learning from FallFury
    http://fallfury.codeplex.com/ (it is in VS 2012 and
    I wasn't able to migrate to VS 2013)

    and Direct3D sprite sample
    http://code.msdn.microsoft.com/windowsapps/Direct3D-sprite-sample-97ae6262

    What I want is to see an animated sprite moving on screen.

    I don't know what reference to add for IMFSourceReader,IMFMediaType>
    to don't have erros in:
        Microsoft::WRL::ComPtr<IMFSourceReader> m_reader;
        Microsoft::WRL::ComPtr<IMFMediaType> m_audioType;
    Thanks


    ADRIAN DIBU

    Wednesday, April 09, 2014 2:07 PM
  • Hi,

    The user create MainMenu is missing from Fish_Hits, why?

    <SwapChainPanel
        x:Class="Fish_Hits.DirectXPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:Fish_Hits" x:Name="XAMLPage"
        xmlns:controls="using:Fish_Hits.Controls"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" Loaded="OnLoaded" KeyDown="OnKeyDown" LayoutUpdated="XAMLPage_LayoutUpdated">

      <Grid x:Name="stkMainMenu" Visibility="Collapsed">

            <StackPanel x:Name="stkMainMenuButtons" Style="{StaticResource MenuPlacement}">
                    <local:MenuItem x:Name="btnNewGame" Label="new game">
                        <local:MenuItem.RenderTransform>
                            <TranslateTransform></TranslateTransform>
            </StackPanel>
       </Grid>

    </SwapChainPanel>

    The user MainMenu code is:

    <UserControl
        x:Class="Fish_Hits.MenuItems.MenuItem"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:Fish_Hits"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        x:Name="menuItem"
        Margin="10, 0, 0, 10">

     <Grid
      Height="65"
      ManipulationMode="TranslateX"
      ManipulationCompleted="Grid_ManipulationCompleted"
      ManipulationDelta="Grid_ManipulationDelta"
      x:Name="ControlContainer"
      PointerPressed="Grid_PointerPressed"
      PointerReleased="Grid_PointerReleased">
           
            <Grid.Resources>
                <Storyboard x:Name="ArrowAnimator">
                    <DoubleAnimation Storyboard.TargetName="ImageTranslateTransform"
                                     Storyboard.TargetProperty="X"
                                     From="0"
                                     To="20"
                                     Duration="0:0:0.4"
                                     RepeatBehavior="Forever"
                                     AutoReverse="True">
                    </DoubleAnimation>
                </Storyboard>

            </Grid.Resources>
           
            <Grid.RowDefinitions>
                <RowDefinition Height="10" />
                <RowDefinition />
       <RowDefinition />
       <RowDefinition Height="10" />
            </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
       <ColumnDefinition Width="10" />
       <ColumnDefinition />
      </Grid.ColumnDefinitions>
      <StackPanel Orientation="Horizontal" Grid.RowSpan="4" Grid.ColumnSpan="4">
       <!-- width is sent in code behind, have to get this dynamic ...  -->
       <Grid Width="350" x:Name="coverRectangle">
        <Rectangle Fill="#303030" />
        <Rectangle
         Fill="Red"
         x:Name="coverActiveRectangle" />
       </Grid>
                <Image x:Name="MenuImage" Source="ms-appx:///MenuItems/single_arrow.png" Margin="10,0,0,0" Stretch="Uniform">
                    <Image.RenderTransform>
                        <TranslateTransform x:Name="ImageTranslateTransform"></TranslateTransform>
                    </Image.RenderTransform>
                </Image>
            </StackPanel>
      <!---->

      <TextBlock
                Text="{Binding ElementName=menuItem, RelativeSource={RelativeSource Self}, Path=Label}"
       Grid.RowSpan="4"
       Grid.ColumnSpan="4"
       Style="{StaticResource MenuItemText}">

            </TextBlock>
           
            <MediaElement x:Name="coreMenuMedia" Source="ms-appx:///Assets/Sounds/MenuTap.wav" AutoPlay="False"></MediaElement>
            <MediaElement x:Name="slideMenuMedia" Source="ms-appx:///Assets/Sounds/MenuSlide.wav" AutoPlay="False"></MediaElement>
        </Grid>
    </UserControl>

    Thanks


    ADRIAN DIBU

    Wednesday, April 09, 2014 2:23 PM
  • Hi,

    When you create a new C++ project in Microsoft Visual Studio (by going to FILE > New > Project or by pressing Ctrl+Shift+N), the dialog presents you with a number of choices. For our purposes here, choose DirectX app as your template.

    That can add windows reference in your app. please see the links below to get more information:

    http://msdn.microsoft.com/en-US/library/windows/apps/dn481529

    If you do not create a namespace named  Fish_Hits in your app so you cannot use it. You can see x:Class attribute

    And for create directX app in windows store you can refer to the link below:

    http://msdn.microsoft.com/en-us/library/windows/apps/JJ126138.aspx

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, April 10, 2014 7:55 AM
  • Hi,

    Thanks for the prompt answer.

    I don't know how to add the namespace Fish_Hits to don't

    have the message The name "MenuItem" does not exist in the namespace "using:Fish_Hits"

    What can I add more at what I have:

    <SwapChainPanel
        x:Class="Fish_Hits.DirectXPage" xmlns:local="using:Fish_Hits"
        x:Name="XAMLPage"

    <UserControl
        x:Class="Fish_Hits.MenuItem" xmlns:local="using:Fish_Hits"
       x:Name="menuItem"

    <Application
        x:Class="Fish_Hits.App"  xmlns:local="using:Fish_Hits"

    Best regards


    ADRIAN DIBU

    Thursday, April 10, 2014 9:15 PM
  • Hi,

    I have a warning:

    warning MSB8027: Two or more files with the name of MenuItem.g.cpp will produce outputs to the same location. This can lead to an incorrect build result.  The files involved are Generated Files\MenuItem.g.cpp, Generated Files\MenuItem.g.cpp.

    What I did wrong and what I suppose to do?

    Thanks


    ADRIAN DIBU

    Thursday, April 10, 2014 9:45 PM
  • Hi,

    You use the source code from codeplex:

    http://fallfury.codeplex.com/

    I think if your have any problem about the project you should directly post your thread in the dissussion:

    http://fallfury.codeplex.com/documentation

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by adibu Friday, April 11, 2014 3:58 PM
    Friday, April 11, 2014 5:49 AM