home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / MAINTEST.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-19  |  1.2 KB  |  31 lines

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4.  
  5. #include "maintest.h"
  6. #include <OleAuto.hpp>
  7. //---------------------------------------------------------------------------
  8. #pragma resource "*.dfm"
  9. TForm1 *Form1;
  10. //---------------------------------------------------------------------------
  11. __fastcall TForm1::TForm1(TComponent* Owner)
  12.   : TForm(Owner)
  13. {
  14. }
  15. //---------------------------------------------------------------------------
  16. void __fastcall TForm1::bRunAutoClick(TObject *Sender)
  17. {
  18.      Variant V;
  19.  
  20.   try{
  21.              V = CreateOleObject("AutoProj.MyAuto");
  22.              V.OleProcedure("ShowDialog");
  23.              V.OlePropertySet("MyProp", "This string was passed to the MyProp property of AutoProj by TestAp");
  24.              V.OleProcedure("ShowDialog");
  25.   }
  26.   catch(Exception *E){
  27.            Application->HandleException(E);
  28.            ShowMessage("Make sure you compile AutoProj first and run it either from the commmand line with the /regserver switch or from Delphi after you set the Run|Parameters dialog to /regserver");
  29.   }
  30. }
  31. //---------------------------------------------------------------------