Print Page | Close Window

SaveToFile fails

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=4049
Printed Date: 01 Jul 25 at 5:47AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: SaveToFile fails
Posted By: JerryK
Subject: SaveToFile fails
Date Posted: 30 Jun 25 at 9:39PM
SaveToFile fails.  
1. Is there a way to find out why?  It has been working fine for several years, until now.
2. Is there a limit to the length of the path?  The length might be a bit longer than used previously, but well below the Windows path length maximum.

Using C and the 1711 library.

Thank you.



Replies:
Posted By: swb1
Date Posted: 30 Jun 25 at 10:05PM
There is not much to the SaveToFile function. A drill down through the code gets us to this API call which tests for save capability:

<result> = CreateFileW(PWideChar(FileName), GENERIC_READ or GENERIC_WRITE,
    0, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)

If that returns false, you cannot save a file.
 
In Delphi I could call  https://docwiki.embarcadero.com/Libraries/Sydney/en/System.GetLastError" rel="nofollow - System.GetLastError - RAD Studio API Documentation  and I might learn "why". I do not know if you have that option in C.

My guess is that the OS is saying "No" for some reason. Maybe permissions, bad path, file in use, etc. but I don't think there is anything about QPL that should be the source of the issue. 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk