Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting .dll error while extracting files
#4
Most of QM zip/unzip code is in file qmzip.dll. It is in QM folder. Problem in exe: QM is not installed on most computers where exe runs.
To solve this, QM adds qmzip.dll to exe resources. Problem 2: dlls cannot be loaded directly from resources or memory.
To solve this, when exe runs and executes zip, it extracts the dll from exe resources, saves in the temp folder and loads the temporary dll file.

This macro shows the path of the temporary file, and 1 if it exists, 0 if not.
Macro Macro2566
Code:
Copy      Help
str tempFile=F"$temp qm$\ver 0x{QMVER}\qmzip.dll"
tempFile.expandpath
out tempFile
out FileExists(tempFile)

Why this could fail? One of reasons - a security software does not allow to create or load dll files in temp folder, especially for unknown programs. Another - there is something wrong in temp folder security settings. Some software may change temp folder security settings (eg Adobe acrobat XI, see http://www.tomshardware.co.uk/forum/338 ... ion-itself).

zip/zip- uses code like this. You can try to execute it in exe on that computer. If fails, it may show the reason.
Macro Macro2567
Code:
Copy      Help
if(0) zip- "c:\z.zip" "c:" ;;this just makes to add qmzip.dll to exe

str tempFile=F"$temp qm$\ver 0x{QMVER}\qmzip.dll"
int hm=ExeExtractFile(11 tempFile 0x101 252)
if(!hm) mes- F"ExeExtractFile failed.[]{GetLastError} {_s.dllerror}"
FreeLibrary hm


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)