1
我目前有一个main.cpp和一个editor.hC++从本机代码的另一种形式获取价值?
这个editor.h是托管代码 main.cpp是本地代码。
在main.cpp中我通常会运行编辑器的一个新实例:
Application::Run(gcnew Editor());
但随后在main.cpp中另一个地方,我想提取这种形式的值,所以我怀疑是我干的像这样: (main.cpp中)
....
Editor^ EditorEntry;
..
..
EditorEntry::Value1....
EditorEntry::Panel1->Name...
int main(..)
{
...
Application::Run(gcnew EditorEntry());
...
}
,但我不能,而得到这样的:
error C3145: 'EditorEntry' : global or static variable may not have managed type 'Cube3D::Editor ^'
那么我该怎么做呢?
Move Editor^EditorEntry;成主要(..)。您可以使用Visual Studio向导生成的全新Windows Fowms应用程序进行检查。但无论如何,你为什么认为你需要编辑器的全局实例? – Simon 2012-07-10 09:06:17
因为我想从main之外收集一个值,在main.cpp – 2012-07-10 09:33:22
任何人都可以帮我吗? – 2012-07-10 13:16:34