home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / OleCont / Main.pas < prev    next >
Pascal/Delphi Source File  |  1998-03-14  |  1KB  |  60 lines

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Menus, OleCtnrs, ExtCtrls;
  8.  
  9. type
  10.   TMainForm = class(TForm)
  11.     OleContainer1: TOleContainer;
  12.     MainMenu1: TMainMenu;
  13.     File1: TMenuItem;
  14.     Edit1: TMenuItem;
  15.     InsertObject1: TMenuItem;
  16.     Exit1: TMenuItem;
  17.     procedure Exit1Click(Sender: TObject);
  18.     procedure InsertObject1Click(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24.  
  25. var
  26.   MainForm: TMainForm;
  27.  
  28. implementation
  29.  
  30. {$R *.DFM}
  31.  
  32. procedure TMainForm.Exit1Click(Sender: TObject);
  33. begin
  34.   Close;
  35. end;
  36.  
  37. procedure TMainForm.InsertObject1Click(Sender: TObject);
  38. begin
  39.   with OleContainer1 do
  40.   begin
  41.     if InsertObjectDialog then
  42.       DoVerb(PrimaryVerb);
  43.   end;
  44. end;
  45.  
  46. (* Delphi 1 code, now obsolete
  47. procedure TForm1.InsertObject1Click(Sender: TObject);
  48. var
  49.   P: Pointer;
  50. begin
  51.   if InsertOLEObjectDlg(Form1, 0, P) then
  52.   begin
  53.     OleContainer1.PInitInfo := P;
  54.     ReleaseOleInitInfo(P);
  55.   end;
  56. end;
  57. *)
  58.  
  59. end.
  60.