| wuzamarine (3) | |
|
This pseudo code does 'not' work in a visual studio environment. In this scenario, line 22 and 25 are undefined because they cannot access the definition in main() even though it is defined. #include <iostream> using namespace std; namespace N{ public ref classForm1 : publicSystem::Forms::Form { public: Form1(string laArray[], int length) { InitializeComponent(); //constructor code } private: System::VoidB() { LoadMyFile (laArray, 2); } public: void PrintArray(string laArray[], int length) { string fileName1; fileName1 = laArray[0]; } } }; int main(array<System::String^>^args) { std::string laArray[2]; laArray[0] ="hello"; laArray[1] ="bye"; PrintArray(laArray,2); return0; Application::Run(gcnew Form1(laArray, 2)); } Actual error and code: http://pastie.org/4783179 form1 http://pastie.org/4783166 main() http://pastie.org/4783187 All I am trying to do is display array data produced in main() inside of a textbox window in my form1. I cannot seem to connect laArray[] in main() with laArray[] in form1 | |
|
|
|
| wuzamarine (3) | |
|
What is 'really' confusing me is that according to http://jcatki.no-ip.org:8080/fncpp/Namespace accessing info in a namespace from main() requires 'namespace::function variable'. But I am going the other way, everything should have access to main() as long as you pass it, which I am????? | |
|
|
|
| modoran (1101) | |
| You better post this in MSDN forums, as here it is unlikely to get an answer for C++/CLI Microsoft propietary language that you are using. | |
|
|
|
| wuzamarine (3) | |
|
I tried gross overkill. line 20, added a global http://pastie.org/4783671 then added line 5 http://pastie.org/4783740 c:\users\wuzamarine\documents\visual studio 2010\projects\winform1\winform1\Form1.h(5): error C2065: 'laArray' : undeclared identifier | |
|
|
|