PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Error codes
  • Operating mode in Windows Vista (and later)
  • Gauge
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Compresses a file. This file can be decompressed by fUncompress.
Remark: The small-size files are not likely to be compressed.
Reminder: Archiving functions (zipXXX functions) allow to manage archives in ZIP, CAB, 7z, etc.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
// Compress a file
Res = fCompress("C:\Directories\File.txt", "C:\Directories\CompressedFile.txt")
Syntax
<Result> = fCompress(<Path of file to compress> , <Path of compressed file>)
<Result>: Integer
  • 0 if the compression was performed,
  • an error code (value greater than 0) otherwise.
<Path of file to compress>: Character string (with quotes)
Name and full (or relative) path of the file to compress (up to 260 characters). A UNC path can be used.
<Path of compressed file>: Character string (with quotes)
Name and full (or relative) path of compressed file (up to 260 characters). A UNC path can be used.
Remarks

Error codes

The following error codes are returned:
  • 1: The file to compress cannot be opened.
  • 2: Unable to create the compressed file. This error occurs if <Path of compressed file> does not exist.
  • 4: The file cannot be compressed: the file is copied (the size of the file to compress is too small for instance).
  • 5: Insufficient memory to perform the compression.
  • 6: The compression was canceled by the user: fStopCompress has been run.
  • 7: Insufficient space to create the compressed file.
The message corresponding to the error code is returned by ErrorInfo with the errMessage constant.
WINDEVUser code (UMC)

Operating mode in Windows Vista (and later)

If this function does not operate properly in Windows Vista (and later), check whether the file or directory used is not in one of the system directories (Windows directory or "Program Files" directory).
Indeed, in Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have the administrator privileges to handle and/or modify the files or directories in the system directories (Windows directory or "Program Files" directory).
Programming tip: To handle and/or modify the files or directories without administrator privileges, you should:
  • avoid writing into the Windows directory or into the "Program Files" directory,
  • use the system directory corresponding to the application (returned by SysDir associated with the srCommonAppData constant).

Gauge

To view the progress of file decompression, an event must be branched on CompressGauge (1174). When this message is received, the _EVE.wParam variable contains the percentage of file compression.
Component : wd240std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment