none
Non OLE clipboard copy and importing clip32.dll RRS feed

  • General discussion

  • I am trying to use CopyToClipboard(string text) to copy text to my clipboard. I cannot use an OLE method of copying to my clipboard because of threading in my application.

    My Code:

        
    [DllImport("clip32.dll")] 
    private static extern bool CopyToClipboard(string text); 
     
    //add the URL to the clipboard 
    public static void AddURLToClipboard( string text ) 
         CopyToClipboard(text); 


    I get a message saying that I cannot import the clip32.dll because the specified module cannot be found. Any ideas on what the problem could be? If you do not about that error, do you know of any other non-OLE ways of copying text to a clipboard?

    Thanks in advance.
    • Changed type Zhi-Xin Ye Wednesday, November 5, 2008 11:29 AM change to comment since no response for more than 3 days
    Thursday, October 30, 2008 3:49 PM

All replies

  • Honestly did you have to post this every day and all over the place? The msdn article where you took your code from actually comes with code and it contains the dll (and the source of it) you are looking for.

    Thursday, October 30, 2008 4:23 PM
  • Did you copy clip32.dll to your project's bin\debug folder?
    Hans Passant.
    Thursday, October 30, 2008 9:46 PM
    Moderator