C++;UWP实现

C++;UWP实现,uwp,c++-cx,Uwp,C++ Cx,所以我一直在做一个赛车游戏,所以我想增加方向盘的支持。我正在使用UWP()。我已经像微软说的那样将代码添加到appxmanifest中,但我仍然收到错误消息。代码如下: Input.cpp #include "pch.h" #include "Input.h" #include <vector> #include <Windows.h> #include <windows.gaming.input.h> #include <windows.gaming.

所以我一直在做一个赛车游戏,所以我想增加方向盘的支持。我正在使用UWP()。我已经像微软说的那样将代码添加到appxmanifest中,但我仍然收到错误消息。代码如下:

Input.cpp

#include "pch.h"
#include "Input.h"
#include <vector>
#include <Windows.h>
#include <windows.gaming.input.h>
#include <windows.gaming.input.custom.h>
#include <windows.gaming.input.forcefeedback.h>

Input::Input()
{

}

bool Input::Detect()
{
    Windows::Gaming::Input::RacingWheel RacingWheel;

    auto Wheels = ref new Vector<RacingWheel^>();

    for (auto racingwheel : RacingWheel::RacingWheels)
    {
        Wheels->Append(racingwheel);
    }
};
-名称后跟::必须是类或命名空间

Vector<RacingWheel^>
向量
-预期类型标识符

-期待一个表情


<>我是C++新手,所以有任何帮助。

< p>你是C++ + cx和正则C++的混合。如果你在C++中写,你不能使用<代码> REF> /CUD>和 ^ 语法,而应该使用正则COM,如果你在C++/CX中写,你不需要包括UWP头,比如< C++ >包含< /Cord>,但是需要通过创建合适的VS项目来编译为C++ +CX。

你还需要确保你的目标是Windows 10周年纪念版(100.1433),这样就可以等待了。< /P> < C++ >你正在混合C++/CX和常规C++。如果你在C++中写,你不能使用<代码> REF> /CUD>和 ^ 语法,而应该使用正则COM,如果你在C++/CX中写,你不需要包括UWP头,比如< C++ >包含< /Cord>,但是需要通过创建合适的VS项目来编译为C++ +CX。


C++还需要确保你的目标是Windows 10周年纪念版(100.1433),这样就可以等待了。它是C++ + CLI吗?不是C++。是C++/CLI吗?

RacingWheel::RacingWheels
Vector<RacingWheel^>