: .
, C++Builder , . , .
1. , File / New Application.
2. Name MainForm, Caption Multiple Forms Test Program.
3. . Main, Multiple.
4. (Button). Name ShowForm2, Caption Show Form 2.
5. File / New Form ( New Form ), . Form1 . , - .
6. , . . .
7. Name SecondForm, Caption A Second Form.
8. File / Save ( Save File ) Second.
9. Label . Caption This is the second form. . . . 3.1.
. 3.1
10. . , . Show Form 2. , .
11. , ( ):
12.
Undefined symbol 'SecondForm' (He 'SecondForm').
...
SecondForm , ...
...
Ara!
, . MainForm SecondForm ( TSecondForm). , . SecondForm MainForm #include. Main.cpp . . :
, Main.h, Second.h, C++Builder . .
|
|
1. File / Include Unit Hdr. Include Unit, . 3.2.
.3.2 Include Unit
2. . Second. Second, , .
Include Unit , . .
OK C++Builder #include Second.h:
Main Second. Run, . . Show Form 2, .
, C++Builder . Include Unit Hdr, , .
V
.
.