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?
Hi,
sometimes on changing printer in my application I get this error.
Maybe these errornumbers are the DOS error codes:
6 DOS file error, invalid file handle.
Best regards,
Otto
In VISTA or 7 it is not allowed (security), to make a file in an application-folder! It should be in temp-folder.
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.
Maybe the (old?) EMF-file is in use?
byte-one wrote:Maybe the (old?) EMF-file is in use?
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