Copying Graphical Data via Enhanced Meta File
Posted
by Oliver Eichler
on August 6th, 1998
CMetaFileDC * m_pMetaDC = new CMetaFileDC(); m_pMetaDC->CreateEnhanced(GetDC(),NULL,NULL,"whatever"); //draw meta file //do what ever you want to do: bitmaps, lines, text... //close meta file dc and prepare for clipboard; HENHMETAFILE hMF = m_pMetaDC->CloseEnhanced(); //copy to clipboard OpenClipboard(); EmptyClipboard(); ::SetClipboardData(CF_ENHMETAFILE,hMF); CloseClipboard(); //DeleteMetaFile(hMF); delete m_pMetaDC;
Altogether it is a pretty straight forward solution as suggested by the help documents provided with VC++ making it a good alternative to Randys code. And it's working with Word 7.0. Tested printing, too. :)
Have fun
Last updated: 11 April 1998

Comments
There are no comments yet. Be the first to comment!