I'm fairly new to Windows programming but am fairly experienced with C and basic C++. Using VS2008 I've created a Windows Forms app. My goal is to use a RichTextBox as a log window for all the other activity. It's easy enough to send ouptut just using richTextBox1->Append(string). What seems to be impossible is to access richTextBox1 outside of a function defined in Form1 in form1.h
So, for example, MyApp.cpp which was created by VS which begins with:
// MyApp.cpp : main project file.
#include "stdafx.h"
#include "Form1.h"
using namespace MyApp;
can't seem to access anything from Form1. And while my textbox was declared private, making a public: System::Windows::Forms::RichTextBox ^OutputWindow still is not accessible by any means I have permutated. I imagine this all being protected for garbage collection reasons but I still need a global call to send text to the screen. I'd rather not throw everything into form1.h inside of Form1 which would likely work as this program could get rather large and must be maintainable by others in the future.
I even created a Log(string) function in Form1 but couldn't access it from MyApp.cpp or lacked the proper syntax to do it.
Sorry for what seems like a bonehead simple question. I've wracked my brain and the web. What may seem obvious to a Windows programmer is not to someone just dropped in it.