Solved

Ole stuff

Posted on 1998-02-16
3
236 Views
Last Modified: 2010-05-18
Hi there,

I want to make my app an ole server like msword (word.basic) so users can use my app within other programs

now the question: how do i do this, i have looked in the manuals but i don't get it. all i ask is an simple example.

something like:

an application that can be closed, restored, minimized, and execute a function using ole BUT also normal buttons.

Best regards,

Arijan
0
Comment
Question by:aluiken
3 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1359319
Some thing from the net :

OLE Tester

From: johan@lindgren.pp.se

This is a VERY simple test that I made myself to get started with OLE. I was asked to add OLE support to a program I made and this is what I did to have a
program to test that my own OLE server worked.

This creates the oleobject upon creation and then whenever you press a button it calls a procedure in the oleserver.



unit oletestu;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
     ttsesed : variant;
  end;

var
  Form1: TForm1;


implementation
uses oleauto;
{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  ttsesed := createoleobject('ttdewed.ttsesole');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ttsesed.openeditfile;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ttsesed.appshow;
end;

end.

Is this good enough, or do you need more? I don't think it can be simpler.
0
 
LVL 1

Author Comment

by:aluiken
ID: 1359320
I have the idea this is an ole client i want to create a server.
0
 
LVL 4

Accepted Solution

by:
d003303 earned 100 total points
ID: 1359321
In D2, say File->New->Automation Object and go through the wizard. In the automated section of the created object you put all procedures that can be called from an OLE client. Register your app by running it once.
In the client, you call your OLE server by CreateOLEObject with the ProgID in the Register procedure of the server. Use the methods in the automated section, that's it.

In D3, the process is mainly the same, but you have to write your own type library. This is documented in the Developers Guide.

Slash/d003303
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now