Error (6) Creating Enhanced Metafile

Error (6) Creating Enhanced Metafile

Postby gkuhnert » Mon Dec 13, 2010 11:40 am

Hi,

sometimes on changing printer in my application I get this error.

- Has someone an idea, what the cause is?
- And is there any listing about the error numbers so I can look up, what the 6 in this case means?
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Error (6) Creating Enhanced Metafile

Postby Otto » Mon Dec 13, 2010 2:23 pm

Maybe these errornumbers are the DOS error codes:

6 DOS file error, invalid file handle.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: Error (6) Creating Enhanced Metafile

Postby byte-one » Mon Dec 13, 2010 3:02 pm

In VISTA or 7 it is not allowed (security), to make a file in an application-folder! It should be in temp-folder.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Error (6) Creating Enhanced Metafile

Postby gkuhnert » Mon Dec 13, 2010 3:44 pm

The Error gives me as filename and -path:

"C:\Users\gilbert\AppData\Local\Temp\1199000.emf"

I also tried to save the preview-file to another directory like d:\test\preview. With the same problem.

The error seems only to occur, when changing the printer. But not always, only sometimes. When I use the standard printer, the error never occurs.
I made a protocol about the hDC of the printer. There always is a handle:
For example:
86053453 <= worked
1327565991 <= mentioned error occurred
1663110226 <= worked fine again.

Now I wonder if the error message is about a wrong handle for the preview file or a wrong handle for the printer.
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Error (6) Creating Enhanced Metafile

Postby byte-one » Mon Dec 13, 2010 4:13 pm

Maybe the (old?) EMF-file is in use?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Error (6) Creating Enhanced Metafile

Postby gkuhnert » Mon Dec 13, 2010 4:15 pm

byte-one wrote:Maybe the (old?) EMF-file is in use?

I assume not as the error can occur also if the computer is freshly turned on and I change my printer at the first print job.
And the file name that is to be created has a name that doesn't exist in the specified directory.
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Error (6) Creating Enhanced Metafile

Postby gkuhnert » Mon Dec 13, 2010 4:46 pm

Otto, Günther,
thanks a lot for your help!!!

I've solved the problem.
After changing the printer sometimes oPrn:nVertRes(), oPrn:nHorzRes(), oPrn:nVertSize(), oPrn:nHorzSize() were 0 and that lead to a place in my source code, where an out-of-date printer handle was used again. No I make a new handle and it works perfect again
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi, RSalazarU and 85 guests