reaching other classes
-
i use visual C++.Net. at starting a new form is formed automaticaly that's name is Form1. but after i form the second form that is Form2, i cannot reach any variable or function in Form1. since i write #include "Form2.h" in Form1.h so i can use any variable or function in Form2 but i don't write #include "Form1.h" in Form2.h so i cannot reach things that is in Form1. when i write #include "Form2.h" in Form1.h and #include "Form1.h" in Form2.h after this the compiler give an error that is "multiple defined variables and functions". so how can i reach the Form1 from Form2.:omg:
-
i use visual C++.Net. at starting a new form is formed automaticaly that's name is Form1. but after i form the second form that is Form2, i cannot reach any variable or function in Form1. since i write #include "Form2.h" in Form1.h so i can use any variable or function in Form2 but i don't write #include "Form1.h" in Form2.h so i cannot reach things that is in Form1. when i write #include "Form2.h" in Form1.h and #include "Form1.h" in Form2.h after this the compiler give an error that is "multiple defined variables and functions". so how can i reach the Form1 from Form2.:omg:
Look at the top of a .h file that ClassWizard creates. Notice that it adds both
#if !defined
and a#pragma once
preprocessor directives. Those are to keep the file from being included more than once.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen