void CMyView::OnEditCopy() { if ( !OpenClipboard() ) { AfxMessageBox( "Cannot open the Clipboard" ); return; } // Remove the current Clipboard contents if( !EmptyClipboard() ) { AfxMessageBox( "Cannot empty the Clipboard" ); return; } // ... // Get the currently selected data // ... // For the appropriate data formats... if ( ::SetClipboardData( CF_??, hData ) == NULL ) { AfxMessageBox( "Unable to set Clipboard data" ); CloseClipboard(); return; } // ... CloseClipboard(); }
{
if ( !OpenClipboard() )
{
AfxMessageBox( "Cannot open the Clipboard" );
return;
}
// Remove the current Clipboard contents
if( !EmptyClipboard() )
{
AfxMessageBox( "Cannot empty the Clipboard" );
return;
}
// ...
// Get the currently selected data
// ...
// For the appropriate data formats...
if ( ::SetClipboardData( CF_??, hData ) == NULL )
{
AfxMessageBox( "Unable to set Clipboard data" );
CloseClipboard();
return;
}
// ...
CloseClipboard();
}