none
Clipboard.SetText OK on Win 7; fails on Win 10 RRS feed

  • Question

  • "Requested Clipboard operation did not succeed."

    The line above is the exception error string that I'm seeing on Win 10. 

    the statement that causes this problem is …

    "Clipboard.SetText(DisplayView.SelectedItems[0].SubItems[6].Text);"

    in both cases (win7 or VS2017/Win10) ...Text is known to be correct (by direct observation with the debugger).

    The identical statement executes just fine on my Win 7 machine.      And here's the frightening part:  if I step through the statement (using a breakpoint and f10) it executes without an exception. I then hit f5 which raises Google Earth Pro with lat, lon on the clipboard and ready to be pasted into the search box.

    Did the Clipboard operation change somewhere along the line between Win7 and VS2017/Win10 ?


    • Edited by Lincoln_MA Friday, September 21, 2018 4:40 AM typo
    Friday, September 21, 2018 4:38 AM

Answers

  • Hi ritehere.

    Nope !    This is a conventional Windows Forms application.   It's 1:09am, and I just got back outta bed to give something I saw earlier a try …. AND IT WORKED!      That is, change the statement from "Clipboard.SetText ….."  to  "Clipboard.SetDataObject".     The former works on my Win 7 machine but Win 10/VS2017 seems to require the latter.

    Boy!   That Google Earth Pro just blows my mind.   That is SOOOO elegant.   Very Well done, Google!

    OK … back to bed; problem solved.

    • Marked as answer by Lincoln_MA Friday, September 21, 2018 8:17 AM
    Friday, September 21, 2018 8:16 AM

All replies

  • "Requested Clipboard operation did not succeed."

    The line above is the exception error string that I'm seeing on Win 10. 

    the statement that causes this problem is …

    "Clipboard.SetText(DisplayView.SelectedItems[0].SubItems[6].Text);"

    in both cases (win7 or VS2017/Win10) ...Text is known to be correct (by direct observation with the debugger).

    The identical statement executes just fine on my Win 7 machine.      And here's the frightening part:  if I step through the statement (using a breakpoint and f10) it executes without an exception. I then hit f5 which raises Google Earth Pro with lat, lon on the clipboard and ready to be pasted into the search box.

    Did the Clipboard operation change somewhere along the line between Win7 and VS2017/Win10 ?


    Are you coding for a Console Application?

    Friday, September 21, 2018 5:21 AM
  • Hi ritehere.

    Nope !    This is a conventional Windows Forms application.   It's 1:09am, and I just got back outta bed to give something I saw earlier a try …. AND IT WORKED!      That is, change the statement from "Clipboard.SetText ….."  to  "Clipboard.SetDataObject".     The former works on my Win 7 machine but Win 10/VS2017 seems to require the latter.

    Boy!   That Google Earth Pro just blows my mind.   That is SOOOO elegant.   Very Well done, Google!

    OK … back to bed; problem solved.

    • Marked as answer by Lincoln_MA Friday, September 21, 2018 8:17 AM
    Friday, September 21, 2018 8:16 AM