align="justify"> { (GetObjectCLSID (), GetProgID (), GetDescription ()); regObj. UpdateRegistry (bRegister);
} _COM_MAP (TCalculateYImpl) _INTERFACE_ENTRY (ICalculateY) _INTERFACE_ENTRY2 (IDispatch, ICalculateY) _COM_MAP ()
/ / ICalculateY: (CalculateY (int x, double a, double b, double * y));
};
# endif / / CalculateYImplH
Вихідний код клієнта:
/ / ---------------------------------------------------------------------------
/ *
Клієнтський додаток розрахунку функції Y
Виконав Крюков П. Г, група ВМКСС - 326
* /
# include
# pragma hdrstop
# include «Unit1. h »
# include
/ / ---------------------------------------------------------------------------
# pragma package (smart_init)
# pragma resource «*. dfm »* Form1;
/ / ---------------------------------------------------------------------------
__fastcall TForm1 :: TForm1 (TComponent * Owner)
: TForm (Owner)
{
}
/ / ---------------------------------------------------------------------------
void __ fastcall TForm1 :: FormCreate (TObject * Sender)
{-> Checked=true;
}
/ / ---------------------------------------------------------------------------
/ / Оброблювач події натискання на кнопку Button1__fastcall TForm1 :: Button1Click (TObject * Sender)
{x0, xn; a, b;
{= LabeledEdit1-> Text. ToInt ();=LabeledEdit2-> Text. ToInt ();=LabeledEdit3-> Text. ToDouble ();=LabeledEdit3-> Text. ToDouble (); server=CreateOleObject («Project1. CalculateY»); (VarType (server) == varDispatch) {* series=Chart1-> GetASeries ();> Clear (); (int i=x0; i <= xn; + + i)> AddXY (i, server. OleFunction («calculateY», i, a, b), «», ColorBox1-> Selected);
} (VarType (server) == varDispatch) server=Unassigned;
} (Exception & e)
{(e. Message. c_str ());
}
}
/ / --------------------------------------------------------------------------- __fastcall TForm1 :: Button2Click (TObject * Sender)
{* series=Chart1-> GetASeries ();> Clear ();
}
/ / --------------------------------------------------------------------------- __fastcall TForm1 :: CheckBox1Click (TObject * Sender)
{-> Visible=CheckBox1-> Checked;
}
/ / ---------------------------------------------------------------------------
void __ fastcall TForm1 :: Button3Click (TObject * Sender)
{();
}
/ / -------------------------------------------------------------------...