Additional info for clarification (hopefully)
OK, I'll rework the question and include more background.
Since Dec. 26th I've been going through tutorials step by step, starting with schoolfreeware.com's visual C++ 2010 Express, then cplusplus.com's c++ tutorial, and most recently cprogramming.com's c++ tutorial. I've successfully created dozens of mostly small programs applying the coding I'm learning. I've also watched youtube walkthroughs and done exercises found there. Most of my work has been directly in c++, though some of the tutorials have started from the visual C++ forms approach (like the schoolfreeware stuff). Before posting my question, I spend several days after work doing google searches, trying to find a single example of the kind of code that would be helpful in my making the gap in understand that I'm missing about how to incorporate objects that work in both the .cpp and the .h code. Many times the links I find return back to threads from this forum, so I thought this may be a good place to ask. I'm not asking anyone to code a project for me, I'm just looking for some code to study and hopefully derive the syntax/logic.
What I think I'm missing is declaring objects in both the .h form and the .cpp form. On the .h file I created a basic form with a button and textbox. In the button code I added the click event, including a call to a function in the .cpp file as follows:
Code:
private: System::Void btnfunction_Click(System::Object^ sender, System::EventArgs^ e) {
testform (btnfunction);
}
. The .cpp file contained the declaration and the actual function code, which was nothing more than an attempt to output a string to the textbox as follows:
Code:
void testform (System::Windows::Forms::Button ^ btnfunction) {
btnfunction-> Text="Function";
}
The compiler is not recognizing btnfunction in the .cpp. (I did #include the .h file, but did not apparently declare btnfunction.)
Does this better clarify what I'm trying to learn?