Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
2.3 KiB

  1. Simple Drag and Drop Sample
  2. ---------------------------
  3. This sample demonstrates an implementation of OLE 2 drag and drop. It allows
  4. drag and drop operations between two instances of the sample application.
  5. For information on compiling and building the sample, see the makefile in
  6. this directory.
  7. Simple Drag and Drop Objects Overview :
  8. ---------------------------------------
  9. Simple Drag and Drop consists of three main objects. The top level is
  10. CSimpleApp, under which is CSimpleDoc, and the innermost level is CSimpleSite.
  11. CSimpleApp is used to hold all the main window information. (eg. handle to
  12. the main window, handles to the main, edit, and help menus and the application
  13. instance) CSimpleApp always exists as long as the simple drag and drop
  14. application is alive.
  15. The next level object is CSimpleDoc object. It is instantiated when a new
  16. document is created. It enables and disables the menu items in the main menu.
  17. Since simple drag and drop is a single document interface application, the
  18. user is only allowed to insert one object into the document. It is
  19. necessary to disable certain items from the main menu to avoid incorrect
  20. selection. It also registers the window for drag and drop and manipulates
  21. the clipboard operations, such as copy to the clipboard, flush the clipboard.
  22. It demonstrates the implementates of two OLE interfaces in its nested classes,
  23. IDropSource and IDropTarget. These two interfaces are implemented as
  24. CDropSource and CDropTarget respectively.
  25. The CSimpleDoc object instantiates two different objects based on the user
  26. selection from the main menu. The CSimpleSite object is instantiated if the
  27. user chooses to insert a new object into the document. CSimpleSite
  28. demonstrates the implementation of IAdviseSink and IOleClientSite through its
  29. nested classes. These two interfaces are implemented as CAdviseSink and
  30. COleClientSite accordingly. CSimpleSite manipulates the storage handling and
  31. acts as a client site to communicate to a remote server. Such server can be
  32. an executable server or a dll server. The CDataXferObj object is instantiated
  33. when the user chooses to copy the existing object from the current document.
  34. it is required to copy an object to the clipboard. CDataXferObj demonstrates
  35. the IDataObject interface implementation and performs data transfer
  36. operations.
  37.