Hi guys. I am still learning C++ using Visual Studio 2005. would someone be kind enough to give me some advise?
I am trying to basically write a GUI (for a serial camera Interface). There is a textBox. Here is my understanding of a program.
files involved:
mainForm.h [This is where all GUI stuff is, including declaration of textBox1]
fileio.h
fileio.cpp [basically in these files i declare open file close file etc.
my question is: inside mainForm.h I have all the declaration of textBox1, menu items etc... I want to be able to access these variables from fileio.cpp file.
for example I want to have:
Code:
void generateComPortList(void)
{
textBox1->Text += "testing" + Environment::NewLine;
}
so basically I want to use write "testing" inside the textBox1 that is placed in the GUI (mainForm.h) - mostly generated by msdn2005 visual studio.
I get the following errors:
Code:
1>Compiling...
1>fileio.cpp
1>.\fileio.cpp(78) : error C2065: 'textBox1' : undeclared identifier
1>.\fileio.cpp(78) : error C2227: left of '->Text' must point to class/struct/union/generic type
1> type is ''unknown-type''
basically I think I dont understand how variables from mainForm.h can be made accessible from fileio.cpp file.
any help? I know I am lacking basic knowledge here about program structures. I hope someone can help me out a bit.