语法错误:标识符'String'

Yan*_*hon 1 c++-cli

我们收到了这段代码作为一项任务,在花了很多时间解决问题之后,我最终得到了一个syntax error : identifier 'String'.我在网上看到的每个人都在使用std::string,但这不是代码所指的内容,因为使用String对象从C#项目调用该函数.

这是宣言:

int findWindow(String ^CaptionText,IntPtr ^%phWnd,
               int %left,int %top,int %right,int %bottom);
Run Code Online (Sandbox Code Playgroud)

我不知道如何解决这个问题.还有其他错误,例如

error C2062: type 'int' unexpected
...
error C2065: 'IntPtr' : undeclared identifier
error C2065: 'String' : undeclared identifier
...
Run Code Online (Sandbox Code Playgroud)

等等

任何帮助赞赏.

我是否应该提到这些错误与作业无关?

Arm*_*yan 5

使用System::String和/ System::IntPtr或写using namespace System;