Path: utzoo!attcan!uunet!dino!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!mms00786 From: mms00786@uxa.cso.uiuc.edu Newsgroups: comp.windows.ms Subject: MetaFile Woes... Message-ID: <118500017@uxa.cso.uiuc.edu> Date: 4 Jun 90 23:48:00 GMT Lines: 45 Nf-ID: #N:uxa.cso.uiuc.edu:118500017:000:1799 Nf-From: uxa.cso.uiuc.edu!mms00786 Jun 4 18:48:00 1990 Hello. I have two questions relating to Metafiles. a) Can someone point out how to display a metafile (.wmf) that was generated using CorelDraw 1.10d? Here's how far I got - I wrote a program that does a GetClipboardData(CF_METAFILEPICT), got the lpMFPict structure, and set up my device mapping mode according to the mm, xExt, and yExt specs. I ran Corel, drew something, copied it to the clipboard, then ran my program. I was *successfully* able to import the metafile. Moreover, I was able to save the metafile to disk, then run another program that was able to correctly display the metafile. However, if I use the same drawing and ask Corel to export it to .wmf file, I am not able to display the picture. I assume it has something to do with the mapping mode etc. Anyone have any info? b) Initially, I thought I'd be ok because there's atleast one way I can get the drawing. But, I am able to copy a surprizingly small number of objects to the clipboard - a few curves, and Corel complains that metafile is too big to copy to clipboard. So how do I import a drawing from Corel? c) Why does Corel crash under the debugging version of Windows/386 when I try to cut or copy? d) Lastly, why won't the following piece of code, drawn closely from Petzold's book, work more than once? hResource = LoadResource(.... LockResource(hResource); hMF = SetMetaFileBits(hResource); GlobalUnlock (hResource); /* Set up the DC ... */ PlayMetaFile(hDC, hMF); DeleteMetaFile (hMF); The first time this code gets executed, everything is just fine - the meta file plays great. The second time around, SetMetaFileBits returns 0, meaning it failed. Why? Thanks for any pointers (or handles, if you get my drift!) Milan .