Click or drag to resize

AppWindow.EnableOleDropTarget Method

X#
Register the window as an OLE drop target.

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD EnableOleDropTarget(
	lEnable
) AS USUAL CLIPPER
Request Example View Source

Parameters

lEnable (Optional)
Type: Usual
A logical value specifying whether to enable (TRUE) or disable (FALSE) the window as a drop target.

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Remarks
A window that is registered as an OLE drop target using AppWindow:EnableOLEDropTarget() can handle OLE drag and drop events and create new OLE objects in response to such events. In the associated handlers, an OLEDragEvent object is passed as a parameter that can be used to create a new OLE object by calling OLEObject:CreateFromOLEDragEvent().
Examples
The following code enables a data window as a drop target and creates a new OLE object inside its OLEDrop handler. It also checks the name of the OLE object to allow only WordPad documents:
X#
 1METHOD EnableOLEDropTarget CLASS DropTargetDataWindow
 2SELF:EnableOLEDropTarget(TRUE)
 3METHOD OLEDrop(oOLEDragEvent) CLASS MyChild
 4LOCAL oOLE AS OLEObject
 5LOCAL lRet AS LOGIC
 6IF oOLEDragEvent:ObjectName == "WordPad Document"
 7oOLE := OLEObject{SELF}
 8oOLE:AllowInPlace := TRUE
 9oOLE:AllowResize := TRUE
10IF oOLE:CreateFromOLEDragEvent(oOLEDragEvent)
11oOLE:Origin := oOLEDragEvent:Position
12oOLE:Show()
13oOLE:SetFocus()
14ENDIF
15ENDIF
See Also