Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug: right-click OLE drag and drop doesn't work properly
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Bug: right-click OLE drag and drop doesn't work properly
Divers
Thread ID:
00675898
Message ID:
00675898
Vues:
92
This is a VFP bug report pertaining to VFP 7 SP1 and prior releases.

When one uses the right mouse button to drag an object supporting OLE drag-and-drop, e.g. an icon on the desktop in Windows Explorer, a context menu appears upon dropping that object. This gives the choice of Moving, Copying, Creating a Link, or Cancelling the drag-and-drop operation. However, it appears that VFP's implementation of OLE drag and drop does not truly support this feature.

The VFP 7 Help file says this:

You can also click the non-default (right) mouse button on the data in a drag source and drag it to a drop target. Depending on the drop target, a context menu may be displayed when you drop the data on the drop target. The context menu contains a set of options that make it possible for you to choose how the data is processed by the drop target.

While it is true that it lets you choose, that choice is ignored, and as far as I can tell there is no way for the program to know what choice was made. The problem seems to be that the target's OLEDragDrop event is fired before the context menu appears, i.e. before the user has made a selection (e.g. Cancel), and there is no other interface provided to obtain the context menu selection. Since the OLE drag source object may be in an arbitrary external program, only a method or property of the drag target can serve this purpose.

To see an illustration of the problem, run either of the Solutions Sample applications relating to OLE drag and drop, i.e. "Fun with OLE Drag and Drop" or "OLE Drag and Drop Data Formats". Instead of using the left mouse button, try using the right mouse button to perform the drag and drop. When the context menu appears, the program has already performed the OLEDragDrop action, rendering the menu at this point useless and misleading.

Placing a NODEFAULT in the target's OLEDragDrop method suppresses the right-click context menu, so this must always be done to avoid the possibility of such errors. It would be nice if this shortcoming in VFP's support of OLE drag and drop were fixed, because the right-click context menu is a useful, standard Windows feature. Otherwise the erroneous VFP Help documentation and Solutions Samples should be adjusted to reflect this VFP limitation.
Montage

"Free at last..."
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform