asimov500
Programmer
- Mar 14, 2008
- 21
Hi there,
I am not new to programming but I am new to C++.
I want to be able to change MFC textBox's in a function to keep my code modular.
The following line works ok in my main code.
textBox1->Text = "Not Pressed";
But when I put it in a function I get a compiler error.
eg
void laughing(){
textBox1->Text = "Not Pressed";
}
The errors are
d:\my documents\visual studio 2008\projects\suzipic\suzipic\Form1.h(164) : error C2065: 'textBox1' : undeclared identifier
d:\my documents\visual studio 2008\projects\suzipic\suzipic\Form1.h(164) : error C2227: left of '->Text' must point to class/struct/union/generic type
type is ''unknown-type''
Can anybody help with this. I have been searching for
an answer for three days now.
I can do this in Visual basic without problems.
Asimov
I am not new to programming but I am new to C++.
I want to be able to change MFC textBox's in a function to keep my code modular.
The following line works ok in my main code.
textBox1->Text = "Not Pressed";
But when I put it in a function I get a compiler error.
eg
void laughing(){
textBox1->Text = "Not Pressed";
}
The errors are
d:\my documents\visual studio 2008\projects\suzipic\suzipic\Form1.h(164) : error C2065: 'textBox1' : undeclared identifier
d:\my documents\visual studio 2008\projects\suzipic\suzipic\Form1.h(164) : error C2227: left of '->Text' must point to class/struct/union/generic type
type is ''unknown-type''
Can anybody help with this. I have been searching for
an answer for three days now.
I can do this in Visual basic without problems.
Asimov