Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-38398

Copying to clipboard fails with CO_E_NOTINITIALIZED error when linked with C++/CLR library

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Out of scope
    • Affects Version/s: 5.2.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows
    • Commits:
      Improve error msgs: 817fe67839154e43998df2f459becf5e08fa5b8b (stable, 25.4.2014, 5.3.1)

      Description

      My Qt appliactions fails to copy selected text from QLineEdit when C++/CLR library is linked.

      If it is linked, but zero calls is invoked from it, everything works OK!

      Otherwise, by clicking Ctr+C I get error message in Application Output (QtCreator) like this:

      OleSetClipboard: Failed to set mime data (text/plain) on clipboard: CO_E_NOTINITIALIZED ()

      Selected text is not copied into clipboard.

      To demonstrate this, I've prepared small test suite, see attachment.

      Firstly, compile "dummy_clr_lib" C++/CLR project using Visual Studio 2010 Express (I do not know if version actually has affect in any way) in release mode, so release/dummy_clr_lib.lib will appear.

      Next, compile "clipboard-test" Qt project, that links to mentioned library.

      Run it in QtCreator/Visual Studio, so Applicaiton Output is visible.

      Select text in line edit, press Ctrl+C - "CO_E_NOTINITIALIZED" error should be printed in output.

      To disable this effect, comment-out this line in MainWindow.cpp:
      dummyCppClrCall();
      ...and copying to clipboard should now work.

      So, it needs at least one C++/CLR call to break something...

      I've selected "Core: Plugins" component because this error (looks like) originates from Windows platform plugin.

        Attachments

        1. qt_clr_clipboard_bug.zip
          26 kB
        2. qtbug38398_diag.patch
          1 kB
        3. qtbug38398.zip
          27 kB

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              • Assignee:
                kleint Friedemann Kleint
                Reporter:
                talkless Vincas Dargis
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes