tool, but this is a bit tricky to copy these records into a text file.
"Joseph M. Newcomer" <newcomer@flounder.com> schrieb im Newsbeitrag
It would help if you knew what the new records were. Consider using my
"Metafile
Explorer" which you can download from my MVP Tips site. Also, in my MSDN
Errors and
Omissions, I have detailed documentation of the metafile records.
joe
On Mon, 14 Dec 2009 15:33:07 +0100, "Michael Reim"
<nospammichaelDOTreim@REMOVENOSPAMANDCAPShelmut-fischer.denospam> wrote:
Hello,
I'm struggling with enhanced metafiles.
What I have is an enhanced metafile on disk, where I want to modify a
comment.
Here is how I try to do this (simplified):
HENHMETAFILE hMetaFile = GetEnhMetaFile(TmpFileName);
HDC hTargetDC = CreateEnhMetaFile(DC.m_hDC, NULL, &Bounds,
_T("WinHCU\0tmp\0\0"));
EnumEnhMetaFile(hTargetDC, hMetaFile, ProtoView_EnhMetaFileReplaceProc,
NULL, &ZeichenRect);
DeleteEnhMetaFile(hMetaFile);
hMetaFile = CloseEnhMetaFile(hTargetDC);
CopyEnhMetaFile(hMetaFile, TmpFileName2);
CloseHandle(hMetaFile);
My Callback function looks like this:
int CALLBACK ProtoView_EnhMetaFileReplaceProc(
__in HDC hDC,
__in HANDLETABLE * lpHTable,
__in const ENHMETARECORD *lpEMFR,
__in int nObj,
__in LPARAM lpData
)
{
return PlayEnhMetaFileRecord(hDC, lpHTable, lpEMFR, nObj);
}
It's no problem for me to identify and modify the comment in the metafile.
The problem is that the metafile increases from 6 records to 29 records
even
if I don't modify anything.
If I do this over and over again the number of records seems to double
every
time.
The same result for PlayEnhMetaFile instead of EnumEnhMetaFile.
So how can I play one metafile into a new one without increasing the
number
of records?
Please see the attached two files for an example. bild1.emf is the
original,
bild2.emf is the increased file.
TIA
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm