[comp.windows.ms.programmer] DLL's and Metafiles and GIF's

c60c-3fz@e260-1g.berkeley.edu (In Sik Rhee) (11/08/90)

Ok folks, what am I doing wrong?  My import filter (which follows
the specs standardized by PageMaker) works.  Its job is to take 
a GIF and convert it to a DIB and then stretching it into a Metafile.
it returns the handle to the metafile.  I have several questions regarding
procedures with metafiles.

1.  the Palette:  when I have created the logical palette, do I select
	it with the metafile handle, or do I do a GetDC(hMetafile)
	then select and realize to this hDC before restoring the DC?
	the way I have it now, I am selecting and realizing the palette
	to the handle of the metafile.

2.  GetMetaFileBits and Set(select?)MetaFileBits...   right now , I am
	calling these after I've finished everything...  is that right?
	hmf = GetMetaFileBits(hmf);
	return (SetMetaFileBits(hmf));

3.  Is there any procedure I am overlooking when I play with the palette
	and make my metafile?   

The problem does not manifest when I call my filter from an application
that will just Play the metafile.  The problem occurs when I am using
Word for Windows or Power Point to import an image... Actually, with
Word, it did import an image, but the success was short-lived, since it
proceeded to crash when I played with the document and menus

4.  Are there any garbage collections that I'm forgetting to do?
	I free all my global allocations (including the palette)
	and the only thing that gets passed out is the handle to the
	Metafile...  

All help/suggestions/comments is appreciated...