Tutorials to .com

Tutorials to .com » Software » Delphi » Object Linking and Embedding (a)

Object Linking and Embedding (a)

Print View , by: iSee ,Total views: 33 ,Word Count: 8612 ,Date: Sat, 18 Apr 2009 Time: 2:37 PM

Object Linking and Embedding (Object Linking and Embeding) is a set of service functions, it provides a different use from the application of information to create a powerful way to compound documents. Almost all objects can be the type of information, such as text, bitmaps, vector graphics, and even voice and video clips such as Notes.

   Windows annex writing group is an example of OLE applications, the use of click "object | insert" menu item, writing  saddle blanket hazeCaramel  said Yue Ying Ao Ao Xin harmonic marine crab Jun-seok Oh? / Font> OLE server program, such as formula editing tools, mapping tools, report generation tool. Double-click the left mouse button the user can activate an OLE server. In the OLE server to edit the OLE object, when a user browser to return to writing at the Writer OLE object will appear in the document.

   delphi support OLE technology, Delphi1.0 can create OLE applications, Delphi2.0 can create OLE automation servers and controllers procedures. Routines introduced in this chapter through Object Linking and Embedding the basic concepts, Delphi method to create OLE objects, OLE Automation, as well as how to develop the concept of OLE automation servers and controllers.

About 8.1 OLE

8.1.1 OLE1.0 and OLE2.0

To date, there are two versions of the OLE: OLE1.0 and OLE2.0. When users activate the OLE server OLE1.0 object server program in the future to open their own form, and focus. OLE Form loses focus, exists in the form of a separate.

   OLE2.0 server using "local" (in place) activation. Means that the local activation server and application menu to menu integration, the status of the server application to replace the state rules, the server application to replace Article Tools toolbar. OLE object in the application form for editing, but all the process of handling by the server.

Create OLE object OLE server determines the manner of activation. If the object of a OLE1.0 compiled in OLE2.0 applications open, the way it used OLE1.0.

8.1.2 Linking and Embedding

Link the data objects stored in the OLE server to create the document, the embedded object data stored in OLE applications.

Link the object file format must be preserved, and only on the OLE server object has been to create a good OLE, OLE links in order to link the OLE object file can be OLE applications or other procedures to amend, OLE and other OLE server applications can also visit and modify the OLE object. Stored in a data object, but multiple applications can be visited.

   Delphi applications that OLE object can be up-to-date data files. When the OLE object application data changes, these changes will be included in all of the objects reflected in other applications.

Embedded OLE object stored in the application, other applications can not access the object. Only in OLE applications in order to activate the OLE object to edit. OLE objects embedded in the document do not need to store all data in the application, which ensure that the OLE data will not be accidentally deleted or modified. Is less than the size of the application because the preservation of the OLE data has increased.

If users want to save changes to the embedded object, you can put data into the OLE document, Section 3 of this chapter will discuss this issue in detail.

   Table 8.1 using the link or embed the principles.

━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━

   When to use when to use embedded links

─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─

Want to modify the source object and source object will be modified, and this

These changes reflected in the other source of some changes are reflected in a particular should be

Applications such as links or text, or text with the procedures

Source may be a number of OLE objects should not be the source of an OLE object should be

Frequent use of the procedure to amend the application to amend the frequent use of the procedure

The source of the document object will not be the source of the frequent transfer of the document object may be changed frequently

Moving, and moving will not be deleted, and will not be deleted

A large object, or object through the network in general is very small, or large objects can not

E-mail distribution through the distribution network or e-mail

━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━

8.1.3 Design of the state to create OLE Object

In Delphi, you can state in the design or operation of the state to create OLE objects, table 8.2 shows the creation of two states the difference between objects.

Table 8.2 the design, operation OLE object to create

━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━

OLE object designed to create a state of operation to create OLE Object

─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─

Object stored in the run file, add the necessary objects stored in a file or only in the run-time

The size of the compiler before the procedure, reducing the size of the compiler

Developers need to visit in the design of OLE server when developers do not need to visit in the design of OLE server

Run-time OLE object has been created, reducing the run-time OLE object has been created, an increase of running

Run-time time

OLE object in the design of the feasibility of run-time editing OLE objects can only be run-time editing

Applications in the design of OLE objects when the number of applications at run time can create a new OLE for

Established as

━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━

In the design of the state, OLE server can not be locally activated only in the body to activate its own window. However, in operation,

As long as the support of the local activation of OLE server, you can use this approach.

8.1.4 OLE type, documents, projects

   OLE object type of decision to create OLE server. Some applications need to create multiple types of OLE objects, such as applications or embedded in the formula at the same time links and pictures. OLE object type has also decided to OLE data types included, links or embedded OLE object type have to be defined.

   OLE document is included in the OLE object data source file. Link the object must use the object file, because the link saved in the document object. If an application has been in existence from the source file to create embedded object, but also the use of OLE documents. For example, if a link to the OLE object QuattiPro notebook TUTOR.WBI stored in D: \ DFFICE \ QPW directory, it is the OLE file D: \ DFFICE \ QPW \ TUTOR.WBI. It is worth noting that OLE object files can only be defined for the link, and for the embedded object, simply type the definition of OLE.

   OLE is the representative of the data link or embedded as part of OLE documents. When applications wish to OLE object OLE file contains more than a small block of data, it must use the OLE item.

For example, in QuattiPro notebook, OLE object links GasCosts the scope of the B4 to B5 grid, OLE project is $ GasCosts; $ B $ 4. $ B $ 5.

8.2 Design of the state to create OLE Object

   Dephi state in the design and operation of the state to create OLE objects. This section describes the design of the state of the creation of OLE objects.

8.2.1 TOLEContainer Parts

To create an OLE object, to be added in the form package OLE container components. Application components include links or embedded objects. With the components can be displayed in the OLE server to edit the data. Components ObjClass, ObjDoc, ObjItem the definition of OLE types of attributes, respectively, documents, projects. To define whether the local activation of OLE objects, use InPlaceActive attributes. If the OLE object can be locally activated, OLE server and OLE menu menu application integration, GroupIndex will determine the value of the properties menu integration.

8.2.2 OLE objects created by these steps:

   1. In the form of increased packet OLE container components;

   2. In the Object inspector, click ObjClass or omitted attributes ObjDoc button, insert object dialog box will appear;

3. If you want to insert the OLE object has been stored in the file, select "Creat From File", then the definition of the object file name and path name. If that is the target link, select the link check box. If it is embedded in the object, select "Creat new", and in the object list box, select the type of OLE object;

   4. Select OK button;

If it is to create a new object, OLE server will be activated on the OLE object can be edited, closed after the completion of editing OLE server. A typical example is click the server in the "File" or "File | Update" menu.

   5. ObjClass at this time included in the corresponding attribute value, if the OLE object from the document already exists to create or insert a

Object links, ObjDoc contains the OLE document properties.

In the design of the target state will be able to paste the OLE object, the steps are as follows:

   1. Activator server application, select the OLE container package components;

   2. On the server, copy the data or object to the clipboard;

   3. To enter the Delphi integrated development environment, select the OLE container package components;

   4. In the form, select the Object inspector properties ObjItem omitted (...) button;

   5. In the list, select the OLE object;

   6. Select "Paste" to create an embedded object or select "Pastelink" link to create objects;

   7. Select OK.

OLE container components package initialization at this time. If you paste an embedded object, ObjClass attribute will contain the appropriate value. If you paste a link object, ObjClass, ObjDoc, ObjItem attributes will be defined. OLE application on behalf of OLE object that contains parts of the picture.

If the OLE server object supports OLE drag-and-drop feature, designed to drag the state of the object from the server to the application, the application will create a link object, the specific steps:

   1. The activation server, and Delphi integration in an open environment to link the object of choice;

   2. In accordance with short-tailed bird left mouse button to drag the OLE object state of form design;

   3. Release the mouse button release of OLE object.

Form will be created and OLE to initialize the application.

8.3 OLE application development

   Delphi can be a state in the design and operation of the state to create OLE objects, on the one introduced in the design of the state of how to create OLE objects, this section will be introduced through the routine operation how to create OLE object, paste the object, drag the object, as well as OLE Object file operations. We developed a OLE.dpr examples of OLE applications

8.3.1 OLE application interface development

   OLE.dpr use of multi-document interface, the parent form has menu, toolbar, status bar, form a sub-package containers OLE components, respectively, presented below. OLE applications menu

   OLE application's menu and other applications broadly consistent with the main menu, if the application in support of the local activation of the OLE 2.0 object, the integration will be carried out menu. OLE server access information to know whether to support the local activation server.

   OLE applications menu attribute decision fusion menu GroupIndex position, that is, integration is the replacement of the main menu menu, or insert to the main application menu.

   OLE server, the integration of three groups of menus: Edit, View, Help, the distribution of each menu the only index of the value of the group. OLE applications in any index value of 1,3,5 in the menu of the menu group when he was OLE server integration with the corresponding index value of the replacement of the menu. In this routine, the edit menu item in the menu server integration was "Edit" to replace. Figure 8.3. Application in order to save the menu, the distribution is different from the index value of 1,3,5.

Table 8.3 of the menu after integration

━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━

Index value of the menu description of the source function (OLE activated)

─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─

0 the use of paper documents and applications from the OLE procedure

Edit 1 Edit OLE object OLE server

Object-2 did not activate the OLE operation OLE object application

View 3 modify the way the observation OLE object OLE server

Form 4 to manipulate OLE application form

Help 5 to visit the server online help   OLE server

━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ ━ OLE Toolbar and Status bar

When the OLE object is activated when the local, OLE server will attempt to use their own tools and be the replacement of the state of OLE applications. If an application wants to local activation, it should be prepared in the application code so that the server status of the use of tools and articles. To achieve this, we must:

● Setting Toolbar and Status bar

● to join in the application of Article status

By modifying the properties of panel components to create tools and state rules.

When the OLE object is activated when the local, panel or other control will be aligned with the OLE server program coordination. This means that

OLE server OLE applications can replace any Align form control, but control can not be locked to replace. For example,

If the panel is the align attribute alTop, alleft, alBottom, alIngh, the control is not locked, OLE server can be replaced. Tools to make application, the state shall not be replaced, can be locked into a true value property.

When the OLE object is activated, OLE server be displayed in the status of the information, OLE applications OnStatusLineEvent components incidents, characters in a text will be transmitted from the OLE server that event handler. OnStatusLineEvent event handler to receive the text of the MSG parameter characters.

Article status code for the following OLE server to receive information:

procedure TOLEObjectForm.OleContainerStatusLineEvent (Sender: TObject;

Msg: String);


OLEFrameForm.StatusBarPanel.Caption: = Msg


8.3.2 Insert the OLE object

When running the object should be used to insert link insert dialog box, Delphi Components dialog box is not inserted, but can be called to display the dialog box InsertOLEObjectDlg function. InsertOLEObjectDlg function declarations are as follows:

function InsertOleObjectDlg (Form: TForm; HelpContext: THelpContext;

var PInitInfo: Pointer): Boolean;

Parameter which is a Form dialog box to insert the form, the general will have the OLE package container components to form the name of Form.

Helplontext parameters defined for the insert object dialog box online help, and if there is no online help applications, HelpContext the value is zero, there is no dialog box will help button.

Parameter is a PInitInfo untyped pointer, a pointer to the OLE components included to initialize the internal data structure information. InsertOLEObjectDlg change the pointer to point to an effective data structure, the structure of the dialog box that contains the list of selected information to initialize the OLE object. When the pointer is used, they should call the process of ReleaseOLEInitInfo occupied by the release of information to initialize the memory.

When the user selects OK button to close the Insert Object dialog box, InsertOLEObjectDlg return to true value, and contains the OLE object PInitInfo point to initialize the data structure information. initialize OLE container components package

In order to make OLE package contains the OLE object container components, must be initialized components. Initialization is the definition of the main components of the OLE type. If the definition of OLE documents and OLE projects, after the completion of initialization, OLE applications will include OLE objects parts.

InsertOLEObjetDlg function call parameters in the OLE object on PInitInfo initialization information, it passed to the OLE container components package PInitInfo attributes, OLE components inclusive ObjClass, ObjDoc, ObjItem attributes will be defined automatically.

Upon completion of initialization, OLE object gave live. OLE control server, the user can be on the OLE object OLE server for editing. OLE objects when the freezing process, OLE container parts package will contain a bitmap image or on behalf of OLE object. OLE container defined package components can be re-activated AutoActive attributes OLE object, by default, double-click the OLE container package components can be hit live OLE object.

OLE object in the initial routine of the code is as follows:

procedure TOLEObjectForm.InitializeOLEObject (Info: Pointer);


OLEContainer.PInitInfo: = Info;

ReleaseOLEInitInfo (Info)


The first initialization process packet pointer to OLE container properties PInitInfo components, and then release its memory space.

Routine when the user clicks on the "Edit | Insert" menu item, Insert Object dialog box will pop up, select the object type, OLE object is activated, the process code is as follows:

  procedure TOLEObjectForm.InsertObject1Click (Sender: TObject);


Info: Pointer;


if InsertOLEObjectDlg (OLEFrameForm, 0, Info) then

InitializeOLEObject (Info);


OLE object 8.3.3 freeze

If the OLE server object is the creation of OLE 1.0, OLE object server will be giving live, focus and control to the OLE server. To freeze an object created by OLE 1.0 to choose "File | Exit" menu item.

If the OLE 2.0 server to support the local activation, activation of OLE objects will be carried out after the OLE server menu integration, and the state of conversion tools and articles. To freeze the target, just in the application form in different parts of the OLE container package anywhere mouse click

Superscript button. [page]

Another way to freeze the object is to OLE container package Active components value attribute set to false. In the routine, the "Object | freeze" function menu items to achieve freeze. Code is as follows:

  procedure TOLEObjectForm.Deactivate1Click (Sender: TObject);


OLEContainer.Active: = False


8.3.4 paste OLE object

Some OLE servers allow users to copy the OLE object to the clipboard, if an OLE object to copy to the clipboard, OLE application package can be initialized OLE container components to paste OLE object. paste dialog

OLE object to paste it into the OLE container package parts, it is necessary to use the Paste dialog box, Delphi dialog box does not paste parts, but can be used PasteSpecialDlg paste function dialog box displayed.

   PasteSpecialDlg function declarations are as follows:

   function PasteSpecialDlg (Form: TForm; Const First: arrang; HelpConcert: THelpCOntext; var Forrmat: Word; var Hardle: THanlle var PInitInfo: Point): Boolean;  

PasteSpecialDlg parameters are defined as follows:

Form Parameters dialog box is a paste form, should be included in OLE container components form package name passed to the Form.

Format is a registered object parameters of the array format, each format is a member of BOLEFormat types of arrays. For example, application objects can be registered in two formats. Registration for the embedded object FEmbedClipFmt, object to the registration link FlinkClipFmt.

BOLEFormat the following statement:

   BOLEFormat: Record

fmtID: Word;

fmtName: array [0 .. 31] of char;

fmtResultName: array [0 .. 31] of char;

fmtMediun: BOleMedium;

fmIsLInkble: Bool;


fmtID is the object ID number of the clipboard format, fmtID clipboard can be a standard format: CF_TEXT, CF_BIFMAP. The use of OLE object, need to register a new clipboard format to deal with OLE objects. Windows-API function in the registration form RegisterClipbordFormat.

fmtName said that the name of the object to appear in the definition of the list dialog box, paste the object name. In the routine, the "% S" to match fmtName, OLE server automatically replaced by the name of the format "% S" parameters. For example, if the OLE server is the brush, in the run-time program "Paintbrush Picture Object" will replace "% S".

   fmtResultName, the definition appears in the paste dialog box, name the results of inspection. In the routine, the "% S" to the fmtResultName. OLE server automatically names in place of the outcome of the format "% S" parameters. OLE ,“ Paintbrush Picture ”“% S ”。

   fmtMedium is the type of BOLEMedium is Windows decided to format the data type object. For example, OLE Alliance

Then the object format is BOLE_MED_STREAM. OLE embedded object format is BOLE_MED_STORAGE. BOLEMedium function BOLEMedium the calculation of the type of need.

   Object Format fmtIsLinkale decision whether or not connected together. Joint fmtIsLinkable even object to true value. FmtIsLinkable embedded object value to be false.

HelpContext parameters dialog box to paste the definition of online help. If an application is not online help, HelpContext the value is zero, there is no dialog box will help button.

Form the definition of parameters for visco-shear plate format is modified by the PasteSpecialDlg function. Dialog box when using paste, the application does not know the format of the clipboard. Therefore used to deal with the Clipboard Format data. Routines in this chapter. PasteSpecialDlg function to format variables FEmbedClipFmt or FLinkClipFmt modified format, the two formats are the main forms OnCreate event of the definition. If the data on the clipboard instead of OLE objects, Format will be modified into other types of formats, such as such as CF_TEXT.

The definition of parameters Landle handle clipboard data. Be modified by the PasteSpecialDlg function. When the clipboard rather than the OLE Object data type, the required access to the clipboard data Handle parameter. Handle is the handle types.

PInitInfo parameter is a pointer to the structure of OLE object pointer to initialize. OLE is initialized in the previous application on the components also used in this guide. PasteSpecialDlg function will be modified to PInitInfo pointer to point to a valid data structure. The structure includes a dialog box to paste the selected OLE object initialization information.

Here are the components dialog box paste.

● clipboard data will be inserted into OLE applications, in order to achieve the target embedded, have to choose "Paste";

● in OLE documents and OLE server resources between applications connected together in order to achieve targets connected together, choose to be: "Paste Line;

● To hear even with the embedded object is displayed as the icon, select "Display As Icon". If this check box is selected, change the icon ( "Chang Icon") button will show through the button can change the default icon OLE objects or labels.

● If the data format is not registered, "Paste", "Paste link" button will be grayed out options. Users can not paste data from clipboard. Routines in this chapter, the data on the clipboard can only be FEmbedClipFmt (embedded objects) and FlinkClipFmt (link target).

● user in the list box to choose the type of data. Sometimes be interpreted as a variety of data types. For example, in OLE server that contains the word processor function to copy text to the clipboard. Application object to text and OLE objects in two ways paste. Selection list box appears the decision by the OLE server.

Users to paste the dialog box, select the OK button, PasteSpecialDlg return to true value, the OLE application PInitInfo initialization information stored in the structure of the point. in the OLE object using the clipboard

OLE object to paste it into the OLE application, must use Windows, even chain RegisterClipboardFormat function object, embedded object registered two new clipboard format. These formats will be fmtIdt record BOLEFormat domain was used.

Routines in this chapter, the procedure registered in the OnCreate event of the OLE object clipboard format, the following code is the main form's OnCreate event:

  procedure TOLEFrameForm.FormCreate (Sender: TObject);


FEmbedClipFmt: = RegisterClipboardFormat ( 'Embedded Object');

FLinkClipFmt: = RegisterClipboardFormat ( 'Link Source');

Fmts [0]. FmtId: = FEmbedClipFmt;

Fmts [0]. FmtMedium: = BOLEMediumCalc (FEmbedClipFmt);

Fmts [0]. FmtIsLinkable: = False;

StrPCopy (Fmts [0]. FmtName, '% s');

StrPCopy (Fmts [0]. FmtResultName, '% s');

Fmts [1]. FmtId: = FLinkClipFmt;

Fmts [1]. FmtMedium: = BOLEMediumCalc (FLinkClipFmt);

Fmts [1]. FmtIsLinkable: = True;

StrPCopy (Fmts [1]. FmtName, '% s');

StrPCopy (Fmts [1]. FmtResultName, '% s');

RegisterFormAsOleDropTarget (Self, Fmts)


Procedures RegistClipBroardFormat function to format a description of the parameters, it returns a value of type Word. This value can only identify the format of the new registration. FEmbdeClipFmt, FlinkClipFmt is TOLEFormat private data members of class. The following statement:


TOLEForaneForm = Class (TForm)



FEmbedClipFmt: Word;

FLinkClipFmt: Word;

function CreateChild: TOLEObjectForm;


Fmts: array [0 .. 1] of BOleFormat;


Registered clipboard format, the format must also be the definition of OLE object in order to paste. The definition of each format in BOLEFormat records. Procedures that may be registered standard clipboard formats and paste in this format. For example: paste text as the format for registration will be recorded as BOLEFormat defined as fmtId domain CF_TEXT, fmt Medium is defined as the domain BOLE_MED_HGLOBOL. BOLEMediumCalc function can be defined as the clipboard format value to calculate fmtMedium. Routines in this chapter, the procedures for the registration of the two formats, an OLE object is the format of the link, and the other is the format of embedded OLE objects.

   BOLEFormat type definition in BOLEDefs unit, BOLEMediumCalc function defined in ToCtrl unit. Therefore the main part of the window of the interface should be added to these two units.


use ..., BOLEDefs, ToCtrl,

Before the paste OLE object, the application must know whether there is in the clipboard OLE object.

   PasteSpecialEnabled paste function to determine the effectiveness of the dialog box. Clipboard Fmts If there are any kind of format definition, PasteSpecialEnable will return to true value, paste the dialog box can be successfully called. Instead call the Paste dialog box will not have any events.

The following code to achieve the "Edit | Paste" menu item features:

procedure TOLEObjectForm.PasteSpecial1Click (Sender: TObject);


ClipFmt: Word;

DataHand: THandle;

Info: Pointer;


if PasteSpecialEnabled (Self, OLEFrameForm.Fmts) then

if PasteSpecialDlg (Self, OLEFrameForm.Fmts, 0,

ClipFmt, DataHand, Info) then

InitializeOLEObject (Info)


Effective only in the Paste dialog box when the "Edit | Paste" menu to be valid, the following code to achieve this functionality:

   procedure TOLEObjectForm.Edit1Click (Sender: TObject);


PasteSpecial1.Enabled: = PasteSpecialEnabled (Self, OLEFrameForm.Fmts)


8.3.5 release of OLE objects

Drag from the OLE server and OLE objects in OLE application is a convenient Object Linking and Embedding approach. Through drag-and-drop operation, users do not need to use the Insert Paste dialog box or dialog box to define the OLE object. And only with the mouse button from the OLE server "grasping" living OLE object, drag the OLE application, release the mouse button, in order to achieve insertion of OLE objects. release of the target OLE registration form

In order to receive a release of the OLE object, there must be a registered form in the Windows release as OLE goal RegisterFormASOLEDropTarget function can be realized with this feature.

   RegisterFormASOLEDropTarger (Form: TFrom; Const Fmts: array of BOlefrom).

Form which is the target release of OLE object form, in the routines in this chapter will be passed to the Form sub-form parameters.

   Fmts object array format. It is the type of array BOLEFormat. To release all the data must be Fmts array elements corresponding BOLEFormat registration.

Routines in this chapter, the registration form Fmts array OnCreate events of the main array of the same statement, namely: object linking and embedding object format format. If you want to receive the release of more types of data, it is necessary to add in the array Fmts other elements. For example, an application to receive a copy of the release, Fmts third element required to increase its fmtId domain for CF_TEXT, BOLEMedium domain for BOLE_MED_HGLOBL.

Do not need to use drag-and-drop process BOLEFormat the fmtName, fmtResultName domain, if only to drag and drop objects without paste, you can not initialize the two domains.

In the main form OnCreate event can call RegisterFormAsOLEDropTorget.

procedure TOLEFrameForm, FormCreate (Sender: TObject);

begin ...

   Register FormASOleDropTarget (Self, Fmts)


Delphi Tutorial Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.