Thread: converting clipboard text 2 a CString

  1. #1
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470

    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,981
    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, 08:08 PM
  2. Replies: 3
    Last Post: 05-25-2005, 01: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, 07: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, 09:45 PM