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