converting clipboard text 2 a CString

This is a discussion on converting clipboard text 2 a CString within the Windows Programming forums, part of the Platform Specific Boards category; Hi to all! I have a problem with converting a string of text in the clipboard to a CString. My ...

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    386

    converting clipboard text 2 a CString

    Hi to all!
    I have a problem with converting a string of text in the clipboard to a CString. My erroneous code looks like this:

    ===========================
    ……
    ……
    OpenClipboard();
    HANDLE clipTxt = GetClipboardData(CF_TEXT);
    ……
    //append to a CString
    m_searchPath += reinterpret_cast<const char*>(clipTxt);
    ……

    =============================

    I don’t get a valid CString after the appending.
    Anyone please show me how to do it properly?

    Thanks.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,691
    Using the Clipboard

    Read it all - or look at the example code for "Paste".

    GlobalLock() - You can call a dog a cat, but that don't make it cat

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Converting a text box value into a character array?
    By n00bguy in forum Windows Programming
    Replies: 3
    Last Post: 07-29-2006, 09:08 PM
  2. Replies: 3
    Last Post: 05-25-2005, 02:50 PM
  3. Small HTML question
    By Thantos in forum Tech Board
    Replies: 4
    Last Post: 12-29-2003, 12:37 AM
  4. Converting CString to int ??
    By eko-eko in forum C++ Programming
    Replies: 2
    Last Post: 07-10-2002, 08:45 PM
  5. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 10:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21