Announcement

Collapse
No announcement yet.

CLIPBOARD and unicode text with v.9

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CLIPBOARD and unicode text with v.9

    Yesterday, I'e got mine copy of new compiler.
    Bob and his team did a major step by adding invaluable features into the compiler.

    Now, I'm playing with some new functions and stuck on CLIPBOARD statement.
    I'm trying to read unicode text from clipboard.(I've pasted some unicoded text from Word document)
    Here is what I'm doing:

    LOCAL vI as LONG, vT AS STRING
    CLIPBOARD GET ITEM %CF_UNICODETEXT to vI
    CLIPBOARD GET TEXT to vT

    .. and content of vT is not unicode, but simple text.

    What I'm doing wrong with CLIPBOARD GET ITEM?
    Thanks,
    Aslan.

  • #2
    Im guessing that CLIPBOARD GET TEXT is a wrapper for GetClipboardData(%CF_TEXT) so it will never return unicode
    But if "CLIPBOARD GET ITEM %CF_UNICODETEXT to vI" works whats the problem?
    Last edited by Wayne Diamond; 25 Aug 2008, 11:55 PM.
    -

    Comment


    • #3
      [delete]
      -

      Comment


      • #4
        from helpfile,
        A data item is retrieved from the CLIPBOARD, and assigned to the LONG or DWORD variable specified by vItem.
        I'm getting -1 for vItem (vI) any time for all unicoded text.
        I suppose, it should (vItem) be a handle to a memory to be used by Globalmem Lock...

        Comment


        • #5
          I think I'd check exactly how that text that is getting pasted to the clipboard.

          Try calling IsClipboardFormatAvailable (%CF_UNICODETEXT) immediately before trying the CLIPBOARD GET ITEM and see what that tells you.

          If that returns TRUE and CLIPBOARD GET ITEM does not return it, you have a 'bug report' to submit. Fortunately you will have a compilable program demonstrating the problem ready to go at that point.

          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Or, you could CLIPBOARD GET TEXT (which looks like it will return any UNICODETEXT as ANSI text under the 'synthesized format rules' ), then convert it yourself using UCODE$... or even test it with the IsTextUnicode() function before converting.
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Michael,

              Thanks for help.
              I've tested different ways, no luck. Even if I paste bitmap into a memory, I didn't get proper handle, only overflow value.
              Will post it to PB's helpdesk.

              Cheers,
              Aslan.

              Comment


              • #8
                Hi Aslan;

                What did PB Support say?

                I've been trying to use the CLIPBOARD command and have experienced the same problems you have.

                This:
                Code:
                    CLIPBOARD GET ITEM %CF_UNICODETEXT TO vItem
                    ?"Pointer: " + HEX$(vItem),,"Address Valid?"
                Returns:
                FFFFFFFF

                While this:
                Code:
                    CLIPBOARD GET TEXT TO txt
                    ?"Clipped Text: " + txt,," Clipboard Text"
                Works correctly as long as the clipped text is ASCII. If the clipped text is unicode it displays a "?" for each character.

                I suspect I'm doing something wrong, but I can't figure out what. I've requested support from PB Support.

                Comment

                Working...
                X