home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / AUTO1.CPP < prev    next >
C/C++ Source or Header  |  1997-02-28  |  1KB  |  43 lines

  1. //----------------------------------------------------------------------------
  2. //Borland C++Builder
  3. //Copyright (c) 1987, 1997 Borland International Inc. All Rights Reserved.
  4. //----------------------------------------------------------------------------
  5. //---------------------------------------------------------------------
  6. #include <vcl.h>
  7. #pragma hdrstop
  8.  
  9. #include "auto1.h"
  10. //---------------------------------------------------------------------
  11. #pragma resource "*.dfm"
  12. TForm1 *Form1;
  13. //---------------------------------------------------------------------
  14. __fastcall TForm1::TForm1(TComponent *Owner)
  15.   : TForm(Owner)
  16. {
  17.   try
  18.   {
  19.        AutoServer = CreateOleObject("BCBAutoSrv.EditServer");
  20.   }
  21.   catch (...)
  22.   {
  23.        ShowMessage("Please build and run the AutoSrv example before this one.");
  24.        Application->Terminate();
  25.   }
  26. }
  27. //---------------------------------------------------------------------
  28. void __fastcall TForm1::Button1Click(TObject *Sender)
  29. {
  30.   AutoServer.OlePropertySet("EditStr", Edit1->Text);
  31. }
  32. //---------------------------------------------------------------------
  33. void __fastcall TForm1::Button2Click(TObject *Sender)
  34. {
  35.   Edit1->Text = AutoServer.OlePropertyGet("EditStr");
  36. }
  37. //---------------------------------------------------------------------
  38. void __fastcall TForm1::Button3Click(TObject *Sender)
  39. {
  40.   AutoServer.OleProcedure("Clear");
  41. }
  42. //---------------------------------------------------------------------
  43.