views:

16

answers:

1

Hi, i am building an outlook addin that utilizes the windows clipboard for temporary storage. When i make a call to Clipboard.Clear() at the end of the process, Windows Explorer crashes and needs to restart.

Does anyone know why this may be?

It ONLY happens on a 64bit OS, not 32bit..

A: 

First, don't ever do this. The windows clipboard is not there for your benefit, it's there for the user. The user owns it, not you. The user doesn't want his data overwritten by your stuff. You cannot save it off somewhere and put it back later, without affecting other apps or altering the data.

“Programs should not transfer data into our out of the clipboard without an explicit instruction from the user.”
— Charles Petzold, Programming Windows 3.1, Microsoft Press, 1992

Chris Thornton