Page 1 of 1

error with Metafile

Posted: Tue Nov 20, 2007 11:48 am
by Silvio
why it let me show this message

"Could not find the enchaned metafile, please check your TEMP enviroment variable"

and the it make a gpf ???



Code: Select all


function GenChild()

   local oWndChild, oBar, oBmp

   DEFINE WINDOW oWndChild OF oWnd MDICHILD COLOR "N/W"   VSCROLL HSCROLL

   DEFINE BUTTONBAR oBar 3D SIZE 25, 25 OF oWndChild

   DEFINE BUTTON OF oBar ACTION PutLabel( oBmp ) TOOLTIP "Label"
   DEFINE BUTTON OF oBar ACTION PutBitmap( oBmp ) TOOLTIP "Bitmap"

   DEFINE BUTTON OF oBar ACTION PreView( oBmp ) TOOLTIP "Preview"



   oBmp:=TEnhMetaFile():New( 20, 40, 535, 784, "TEST", oWndChild,;
               CLR_WHITE, CLR_BLACK )


   ACTIVATE WINDOW oWndChild

   

return nil

Posted: Tue Nov 20, 2007 12:29 pm
by Antonio Linares
Silvio,

Because the metafile file is not found

Code: Select all

      if file( ::cCaption )
         ::hMeta = GetEnhMetaFile( ::cCaption )
      elseif ! Empty( ::cCaption )
         Alert( "Could not find the enhanced Metafile," + CRLF + ;
                "please check your TEMP environment variable" )
      endif

Posted: Tue Nov 20, 2007 12:34 pm
by Silvio
and How I must make to not show it ?

Posted: Tue Nov 20, 2007 12:40 pm
by Antonio Linares
Use the filename of an existing metafile file

Posted: Tue Nov 20, 2007 12:54 pm
by Silvio
and if I create an temp metafile How I must make it ?

Posted: Tue Nov 20, 2007 2:07 pm
by Antonio Linares
Silvio,

Use CreateEnhMetaFile()

Posted: Wed Nov 21, 2007 12:14 am
by Silvio
I not found the parameters for it

Posted: Wed Nov 21, 2007 7:08 am
by Antonio Linares