home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / AUTO2.CPP < prev    next >
C/C++ Source or Header  |  1997-02-14  |  3KB  |  81 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. #undef RegisterClass
  9.  
  10. #include "Auto2.h"
  11. #include "Auto1.h"
  12. //---------------------------------------------------------------------
  13. int Initialization();
  14. static int Initializer = Initialization();
  15. //---------------------------------------------------------------------
  16. __fastcall ButtonServer::ButtonServer()
  17.   : TAutoObject()
  18. {
  19. }
  20. //---------------------------------------------------------------------
  21. String __fastcall ButtonServer::GetEditStr()
  22. {
  23.   return Form1->Edit1->Text;
  24. }
  25. //---------------------------------------------------------------------
  26. void __fastcall ButtonServer::SetEditStr(AnsiString NewVal)
  27. {
  28.   Form1->Edit1->Text = NewVal;
  29. }
  30. //---------------------------------------------------------------------
  31. int __fastcall ButtonServer::GetEditNum()
  32. {
  33.   int val;
  34.  
  35.   sscanf(Form1->Edit1->Text.c_str(), "%d", &val);
  36.   return val;
  37. }
  38. //---------------------------------------------------------------------
  39. void __fastcall ButtonServer::SetEditNum(int NewVal)
  40. {
  41.   Form1->Edit1->Text = NewVal;
  42. }
  43. //---------------------------------------------------------------------
  44. void __fastcall ButtonServer::Clear()
  45. {
  46.   Form1->Edit1->Text = "";
  47. }
  48. //---------------------------------------------------------------------
  49. void __fastcall ButtonServer::SetThreeStr(AnsiString s1, AnsiString s2, AnsiString s3)
  50. {
  51.   Form1->Edit1->Text = s1 + ", " + s2 + ", " + s3;
  52. }
  53. //---------------------------------------------------------------------
  54. void __fastcall ButtonServer::SetThreeNum(int n1, int n2, int n3)
  55. {
  56.   AnsiString s1(n1), s2(n2), s3(n3);
  57.  
  58.   Form1->Edit1->Text = s1 + ", " + s2 + ", " + s3;
  59. }
  60. //---------------------------------------------------------------------
  61. void __fastcall RegisterButtonServer()
  62. {
  63.   TAutoClassInfo AutoClassInfo;
  64.  
  65.   AutoClassInfo.AutoClass = __classid(ButtonServer);
  66.   AutoClassInfo.ProgID = "BCBAutoSrv.EditServer";
  67.   AutoClassInfo.ClassID = "{61E124E1-C869-11CF-9EA7-00A02429B18A}";
  68.   AutoClassInfo.Description = "Borland C++Builder AutoSrv Example Server Class";
  69.   AutoClassInfo.Instancing = acMultiInstance;
  70.   
  71.   Automation->RegisterClass(AutoClassInfo);
  72. }
  73. //---------------------------------------------------------------------
  74. int Initialization()
  75. {
  76.   RegisterButtonServer();
  77.   return 0;
  78. }
  79. //---------------------------------------------------------------------
  80.  
  81.