解决方案 »

  1.   

    http://www.pudn.com/downloads71/sourcecode/graph/texture_mapping/detail258249.html
      

  2.   

    Determine whether the data to be copied is native data or is an embedded or linked item.
    If the data is embedded or linked, obtain a pointer to the COleClientItem object that has been selected.
    If the data is native and the application is a server, create a new object derived from COleServerItem containing the selected data. Otherwise, create a COleDataSource object for the data.
    Call the selected item's CopyToClipboard member function.
    If the user chose a Cut operation instead of a Copy operation, delete the selected data from your application.
    To see an example of this sequence, see the OnEditCut and OnEditCopy functions in the MFC OLE sample programs OCLIENT and HIERSVR. Note that these samples maintain a pointer to the currently selected data, so step 1 is already complete.
      

  3.   

    非常感谢!但是,用COleDataSource,是用到MFC的库吧,我的项目工程里面,用到MFC的库,设置之后,很多类都编译问题,所以要避免使用MFC的东西。能否还有其他的方法?
      

  4.   

    对了,二楼回复的,那个只是针对Bitmap,其他格式的图片,比如GIF,JPG等,我给定图片路径,怎样复制到剪切板呢!在下菜鸟一枚,还望高手指点啊!非常感谢
      

  5.   

    补充一点,我知道SetClipboardData,但是图片SetClipboardData是以CF_DIB的数据格式吧,请问怎样将图形转换成这种数据格式呢?
      

  6.   

    搞个richedit...简单的实现一下IRicheditOleCallBack(比较简单),把你要复制的内容都加入richedit中去,直接全选所有内容,发送个复制消息,OK...什么都到剪贴板上去了,格式兼容性还好;
      

  7.   

    但是richedit里面插入图片复制不了啊,求大神支招!