home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / MAINTEST.CPP < prev    next >
C/C++ Source or Header  |  1997-02-14  |  2KB  |  42 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 "maintest.h"
  10. #include <OleAuto.hpp>
  11. //---------------------------------------------------------------------------
  12. #pragma resource "*.dfm"
  13. TForm1 *Form1;
  14. //---------------------------------------------------------------------------
  15. __fastcall TForm1::TForm1(TComponent* Owner)
  16.   : TForm(Owner)
  17. {
  18. }
  19. //---------------------------------------------------------------------------
  20. void __fastcall TForm1::bRunAutoClick(TObject *Sender)
  21. {
  22.   Variant V;
  23.  
  24.   try{
  25.     V = CreateOleObject("AutoProj.MyAuto");
  26.     V.OleProcedure("ShowDialog");
  27.     V.OlePropertySet("MyProp",
  28.                      "This string was passed to the MyProp "
  29.                      "property of AutoProj by TestAp");
  30.     V.OleProcedure("ShowDialog");
  31.   }
  32.   catch(EOleSysError& e){
  33.     char buf[256];
  34.     sprintf(buf, "%s.\n\n%s", e.Message.c_str(),
  35.             "Make sure you compile AutoProj first and run it either from\n"
  36.             "the commmand line with the /regserver switch or from C++Builder\n"
  37.             "after you set the Run|Parameters dialog to /regserver.");
  38.     ShowMessage(buf);
  39.   }
  40. }
  41. //---------------------------------------------------------------------
  42.