Re: Ole Clipboard or Drag drop of Metafile image

arasu <arasakumaran-/[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
Thanks for the response.

Yes I looked at the MFC source.  Two things with the MFC code.  MFC's CMetafileDC class has an m_hAttribDC which is typically set to the screen's sometimes to a printer's dc. While drawing, MFC uses this m_hAttribDC as opposed to the m_hDC for measuring, setting mapmode etc.  WTL does not have this and if I am to duplicate the drawing code. I need to derive a class from CDC or from CEnhMetaFileDC and add this reference hdc and duplicate some of the code.

As to placing the enhmetafile on to the DataObject, the MFC code places a metafile rather than enhmetafile.  The code creates a metafile header structure in HGlobal, fills that structure with information about the metafile (size, handle etc..) and places that with CF_METAFILEPICT as the clipboard format.  I don;t have an enhmetafile example even in MFC.   Now, EnhMetafile is supposed to already contain the size, name and such information in addition to the metafile records & there is both clipboard format for enhanced metafile as well as a TYMED for it.  So I was hoping to do this a bit more straightforward, such as by just placing the HENHMETAFILE handle in the STGMEDIUM as part of SetData  Does not seem to work though 

Don;t know if all that made sense, but I can post the code I tried if needed.



--- On Thu, 4/15/10, Angus Comber <angus-v2qo0/[email protected]> wrote:

From: Angus Comber <angus-v2qo0/[email protected]>
Subject: Re: [wtl] Ole Clipboard or Drag drop of Metafile image
To: [email protected]
Date: Thursday, April 15, 2010, 2:00 AM







 



  


    
      
      
      In this situation I would make a MFC example and just step thru the code. You have the MFC sources do you not?



-----Original Message-----

From: "arasakumaran" <arasakumaran@ yahoo.com>

Date: Thu, 15 Apr 2010 02:44:57 

To: <wtl@yahoogroups. com>

Subject: [wtl] Ole Clipboard or Drag drop of Metafile image



I am porting some code from MFC.  I need to place a metafile ( or enhanced metafile) into the data-object being used for the drag/drop. There are IDataObject implementation samples to do this that work fine (one from Viksoe, one in Codeproject from Dunn etc. ) for text, bitmap etc.  But I don't know quite how to do this for CF_ENHMETAFILE. 



Also, MFC uses 'm_hAttributeDC' to help in some of the text/drawing functions while drawing in metafileDC  - how would I do the equivalent in WTL, the drawing code uses GetTextExtentEx, which fails in the metafile DC.



Thanks.



[Non-text portions of this message have been removed]





    
     

    
    


 



  






      

[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.