Contents
OLE Sample Help

Sample Description:  OLE Demonstation

Points of Interest

Embedding an OLE Object on the Form

Linked vrs. Embedded Objects

OLE Automation

In-Place Editing OLE objects

Drag-and-Drop OLE files on a Form

Controls

For Help on Help, Press F1


Embedding an OLE Object on the Form

You use the OLE control to display an OLE object on a form in your Envelop application.  The OLE control on the demonstration form was added via. the Controls palette.

An OLE object points to a particular unit of data that is provided by an OLE application. One application can reveal a surprising number of object types. For example, a spreadsheet application can support several distinct object types such as chart, cell or range of cells, worksheet, or macro sheet.

With the OLE control you can create linked and embedded objects. These linked or embedded objects contain the name of the application that provided the object, its data or a reference to the data, and an image of what the data looks like. Only one object is allowed in an OLE control at any one time.

An application becomes a container when the OLE control is used to embed or link data from another application. This container application then receives the objects data and also displays it.  Our demonstration application is considered an OLE container.


OLE Demonstration

The purpose of the OLE Demonstration is to show how an Envelop OLE object can be placed on an application form and used to display data from other OLE compatible applications.

The OLE control provides an interface to the technology of Object Linking and Embedding.  The OLE technology allows Windows-based application programmers to create applications that can display data from several different applications as well as integrate the functions of the active application into the Envelop application's toolbar.  A user can then edit and update the data from within the original application without having to exit the Envelop application.

Applications that allow OLE automation allow you to use their objects, properties, and methods just as you use custom Envelop objects, and methods.


Linked vrs. Embedded Objects

Linked Objects

One way an OLE control allows data from other applications to be brought into an Envelop application is by linking. When an OLE object is linked, the OLE control simply stores an image of the data and a link pointing back to the original data. The original data is stored in the source file for that object. This is the feature that allows an objects data to be accessed from within several different applications that contain a link to that data.  If modifications are made to a linked object, the changes will appear in all the applications linked to it.

Embedded Objects

Another way an OLE control allows data from other applications to be brought into an Envelop application is by embedding. Data associated with an embedded object is actually stored in the OLE control itself. This data can be saved by your Envelop application and stored in a file. This file contains the name of the application that created the object originally, the actual data, and an image of the data for display. It is this feature that prevents all other applications from accessing the data.

You have complete control of embedded data, meaning that only your application can maintain the data that is produced and edited in another application.


OLE Automation

OLE Automation is supported by a growing number of applications. These applications provide compatible objects for operations involving OLE automation. Some objects that support OLE automation also support linking and embedding. If an object in the OLE control supports OLE Automation, you can access its data using the Automate property.


In-Place Editing OLE objects

Some OLE Objects support in-place editing, meaning there is no need to launch the application of origin in a separate window. You can use the Envelop application to manipulate these objects as if they were its own. The menu, toolbars, etc. of the container application are automatically replaced with those of the objects application.

To In-Place edit a particular application file, you must first drag-and-drop an application file from one of the (7) application icons.  Once the application file is displayed on the demonstration form, simply double-click the Left mouse button over the application file.  This will load the parent application.


Drag-and-Drop OLE files on a Form

An objects class identifies the program that supplies the OLE object along with the objects data and data type. Some example class names include MSDraw, CorelChart, SoundRec, WordDocument, and ExcelWorksheet. The available classes vary from system to system.

The OLE Demonstration form contains (7) types of OLE supported classes.  Each class is represented by in a row of icons at the top of the demonstration form.  From left to right, these include:

1.  Windows Sound Files (.WAV)

2.  Microsoft Write Files (.WRI)

3.  Microsoft Excel Files (.XLS)

4.  Microsoft Paint Files (.BMP)

5.  Microsoft Word Files (.DOC)

6.  Microsoft PowerPoint Files (.PPT)

7.  Windows Notepad Files (.TXT)

Running the Demonstration

To run the OLE demonstration, simply position the screen cursor over any of the (7) icons displayed at the top of the form and press and hold the Right Mouse Button over the icon.  Now drag the cursor over the bottom portion of the form and release the RMB.

You can also drag-and-drop a supported OLE file from the Windows File Manager onto the OLE demonstration form.