Copyright: Clipboard Assistant Component Help


Clipboard Assistant Component - Overview
Clipboard Assistant Component: Overview

The Clipboard Assistant component adds clipboard support to MFC CView-derived classes. Use this component if you would like your application to include clipboard support.

Clipboard Assistant Component: Specifics

Clipboard Assistant Component: Results


Clipboard Assistant Component: Specifics

The Clipboard Assistant component can be applied to any MFC project that contains at least one CView-derived class.

The Clipboard Assistant component will not modify a class if there are already similar member functions present. This means that you cannot apply this component to a CView-derived class that already has one or more member functions identical to the member functions listed in the last step of the Clipboard Assistant Wizard. To successfully apply this component to such a class, you will first need to remove all similar functions and message maps from the class.

The code in the IsSelected and DoCutCopyPaste functions is generic placeholder code. This code will work correctly with AppWizard-generated SDI or MDI type applications, given that the associated CDocument-derived class actually saves something in its Serialize function. If the associated CDocument-derived class does not serialize any data to disk, the copy and cut clipboard operations will subsequently generate an assert. In any case, you will most certainly want to review this code and probably replace it with something more appropriate for your specific application.

The Clipboard Assistant component does not support Undo operations with the custom clipboard format support option.


Clipboard Assistant Component: Results

The Clipboard Assistant component adds clipboard support to MFC CView-derived classes. Two different implementations of clipboard support are provided by this component: simple support for EDIT and/or RICHEDIT controls and generic support using a custom clipboard format.

•	Use simple support for when you have EDIT or RICHEDIT controls as child windows in your view class: for example in a CFormView-type class. This option will insert the appropriate member functions to the specified view class to support Cut, Copy, Paste, and Undo operations from EDIT and RICHEDIT controls.

•	Use generic support, with the custom clipboard format, for when you wish to copy proprietary data from one view window to another. This option adds support to your class for Cut, Copy, and Paste operations via a custom clipboard format. Because a custom clipboard format is used, the data will only be recognized by the view class this component is applied to. This means you can only copy and paste data to and from instances of this specific view class. Other applications and view types will not recognize this custom clipboard format.

Note   Generic support, with the custom clipboard format, adds generic placeholder code to the IsSelected and DoCutCopyPaste functions. Please be sure to read the // TODO: comments that are inserted into these functions. You will need to add additional code to these functions to finalize your support for these menu items.


Clipboard Assistant Component

Select one of the following to add clipboard support to one of your project’s view classes:

•	Edit and rich text controls

•	Custom clipboard format

Choose edit and rich text controls when you have EDIT or RICHEDIT controls as child windows in your view class.

Choose custom clipboard format when you wish to copy proprietary data from one view window to another.


Clipboard Assistant Component

Use the drop-down combo box to add clipboard support to the selected View Class. This combo box lists all the classes derived from CView that are in your project.

Select the type of controls you want clipboard support for, by choosing at least one of the check boxes:

•	Edit controls

•	Rich edit controls

Check the Edit Controls check box, if the selected view class will have child edit controls. Check the Rich Edit Controls check box, if the selected view will have child rich edit controls.

If the selected view will contain both types, select both check boxes.


Clipboard Assistant Component

Use the drop-down combo box to add clipboard support to the selected View Class. This combo box lists all the classes derived from CView that are in your project.

Enter a text string in the Custom clipboard format name field to identify the format name.


Clipboard Assistant Component

The window lists the modifications that will be made to your project files. Click the finish button to complete the Clipboard Assistant component.