i currently have a main.cpp and a editor.h
The editor.h is managed code
the main.cpp is native code.
In main.cpp i normally would run a new instance of Editor:
Application::Run(gcnew Editor());
But then another place in main.cpp i wanted to extract a value from that form, so i suspected that i did it like this:
(main.cpp)
....
Editor^ EditorEntry;
..
..
EditorEntry::Value1....
EditorEntry::Panel1->Name...
int main(..)
{
...
Application::Run(gcnew EditorEntry());
...
}
But i can’t, and get this:
error C3145: 'EditorEntry' : global or static variable may not have managed type 'Cube3D::Editor ^'
So how would/should i do this?
Does the piece of code that needs to read the editor values needs itself to be in native code ? Could it be in another managed class ? You could for example pass the editor to this class so that it can read its properties.
EditorObserverwould keep a field with theEditorEntrypassed in its constructor, and would be able to access its public interface, listen to its events, etc.In an Object Oriented application you wouldn’t put too much code in the main.cpp anyway.