3.4 Guidelines for Windows Metafiles

To ensure that metafiles can be transported between different computers and applications, any application that creates a metafile should make sure the metafile is device-independent and sizable.

The following guidelines ensure that every metafile can be accepted and manipulated by other applications:

1.Set a mapping mode as one of the first records. Many applications, including OLE applications, only accept metafiles that are in MM_ANISOTROPIC mode.

2.Call the SetWindowOrg and SetWindowExt functions. Do not call the SetViewportExt or SetViewportOrg functions if the user will be able to resize or change the dimensions of the object.

3.Use the MFCOMMENT printer escape to add comments to the metafile.

4.Rely primarily on the functions listed in Section 3.2, “Typical Metafile Record.” Observe the following limitations on the functions you use:

Do not use functions that retrieve data (for example, GetActiveWindow or EnumFontFamilies).

Do not use any of the region functions (because they are device dependent).

Use StretchBlt or StretchDIB instead of BitBlt.