12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

344 Day 9<br />

List<strong>in</strong>g 9.2. JJMa<strong>in</strong>.h.<br />

1: //--------------------------------<br />

2: #ifndef JJMa<strong>in</strong>H<br />

3: #def<strong>in</strong>e JJMa<strong>in</strong>H<br />

4: //--------------------------------<br />

5: #<strong>in</strong>clude <br />

6: #<strong>in</strong>clude <br />

7: #<strong>in</strong>clude <br />

8: #<strong>in</strong>clude <br />

9: #<strong>in</strong>clude <br />

10: //----------------------------------<br />

11: class TMa<strong>in</strong>Form : public TForm<br />

12: {<br />

13: __published: // IDE-managed Components<br />

<strong>14</strong>: TButton *Start;<br />

15: TButton *Stop;<br />

16: TImage *Image;<br />

17: TLabel *Label;<br />

18: void __fastcall FormCreate(TObject *Sender);<br />

19:<br />

20: void __fastcall StartClick(TObject *Sender);<br />

21: void __fastcall StopClick(TObject *Sender);<br />

22: private: // User declarations<br />

23: bool done;<br />

24: void DrawImage(Str<strong>in</strong>g& name);<br />

25: public: // User declarations<br />

26: virtual __fastcall TMa<strong>in</strong>Form(TComponent* Owner);<br />

27: };<br />

28: //--------------------------------<br />

29: extern TMa<strong>in</strong>Form *Ma<strong>in</strong>Form;<br />

30: //--------------------------------<br />

31: #endif<br />

List<strong>in</strong>g 9.3. JJMa<strong>in</strong>.cpp.<br />

1: //----------------------------------------------------------<br />

2: #<strong>in</strong>clude <br />

3: //<br />

4: // have to add this <strong>in</strong>clude for the PlaySound() function<br />

5: //<br />

6: #<strong>in</strong>clude <br />

7: #pragma hdrstop<br />

8:<br />

9: #<strong>in</strong>clude “JJMa<strong>in</strong>.h”<br />

10: //----------------------------------------------------------<br />

11: #pragma resource “*.dfm”<br />

12: //<br />

13: // def<strong>in</strong>es for the str<strong>in</strong>g resources<br />

<strong>14</strong>: //<br />

15: #def<strong>in</strong>e IDS_UP 101<br />

16: #def<strong>in</strong>e IDS_DOWN 102<br />

17:<br />

18: TMa<strong>in</strong>Form *Ma<strong>in</strong>Form;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!