Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UnRar + library problem
#1
I want to make a macro that automatically unrars a .rar file if it is added to a directory.
I could not find anything about working with rars in QM so I downloaded UnRAR.dll from http://www.rarlab.com/rar_add.htm
I ran some exe or something that did who knows what but showed a directory of some .dll files
Then in QM I went to Tools->Type Libraries Clicked Register...
tried the normal .dll tried the 64 bit one (I have 64bit Vista)
Error Message:

Component: failed
library: failed


I also read somewhere to type this in run
regsvr32 "C:\Windows\System32\unrar64.dll"

and got "The module "C:Windows\System32\unrar64".dll was loaded but the entry-point DLLRegisterServer was not found. Make sure it is a valid DLL."


Am I doing something wrong? (likely)
or is this .dll not compatible with qm.
#2
It is not COM dll.
In the installation folder there is unrar.h file containing dll function declarations etc. Here it is converted to QM:

Macro unrar
Code:
Copy      Help
type CHANGEVOLPROC = #
;;;function# $ArcName Mode
def ERAR_BAD_ARCHIVE 13
def ERAR_BAD_DATA 12
def ERAR_ECLOSE 17
def ERAR_ECREATE 16
def ERAR_END_ARCHIVE 10
def ERAR_EOPEN 15
def ERAR_EREAD 18
def ERAR_EWRITE 19
def ERAR_MISSING_PASSWORD 22
def ERAR_NO_MEMORY 11
def ERAR_SMALL_BUF 20
def ERAR_UNKNOWN 21
def ERAR_UNKNOWN_FORMAT 14
type PROCESSDATAPROC = #
;;;function# $Addr Size
dll unrar #RARCloseArchive hArcData
dll unrar #RARGetDllVersion
type RARHeaderData !ArcName[260] !FileName[260] Flags PackSize UnpSize HostOS FileCRC FileTime UnpVer Method FileAttr $CmtBuf CmtBufSize CmtSize CmtState
type RARHeaderDataEx !ArcName[1024] @ArcNameW[1024] !FileName[1024] @FileNameW[1024] Flags PackSize PackSizeHigh UnpSize UnpSizeHigh HostOS FileCRC FileTime UnpVer Method FileAttr $CmtBuf CmtBufSize CmtSize CmtState Reserved[1024]
dll unrar #RAROpenArchive RAROpenArchiveData*ArchiveData
type RAROpenArchiveData $ArcName OpenMode OpenResult $CmtBuf CmtBufSize CmtSize CmtState
type RAROpenArchiveDataEx $ArcName @*ArcNameW OpenMode OpenResult $CmtBuf CmtBufSize CmtSize CmtState Flags Reserved[32]
dll unrar #RAROpenArchiveEx RAROpenArchiveDataEx*ArchiveData
dll unrar #RARProcessFile hArcData Operation $DestPath $DestName
dll unrar #RARProcessFileW hArcData Operation @*DestPath @*DestName
dll unrar #RARReadHeader hArcData RARHeaderData*HeaderData
dll unrar #RARReadHeaderEx hArcData RARHeaderDataEx*HeaderData
dll unrar RARSetCallback hArcData Callback UserData
;;;Callback: function# msg UserData P1 P2
dll unrar RARSetChangeVolProc hArcData ChangeVolProc
;;;ChangeVolProc: function# $ArcName Mode
dll unrar RARSetPassword hArcData $Password
dll unrar RARSetProcessDataProc hArcData ProcessDataProc
;;;ProcessDataProc: function# $Addr Size
def RAR_DLL_VERSION 4
def RAR_EXTRACT 2
def RAR_OM_EXTRACT 1
def RAR_OM_LIST 0
def RAR_OM_LIST_INCSPLIT 2
def RAR_SKIP 0
def RAR_TEST 1
def RAR_VOL_ASK 0
def RAR_VOL_NOTIFY 1
def UCM_CHANGEVOLUME 0
def UCM_NEEDPASSWORD 2
def UCM_PROCESSDATA 1
type UNRARCALLBACK = #
;;;function# msg UserData P1 P2
type UNRARCALLBACK_MESSAGES = #
def _UNRAR_DLL_

Here is how to use it:
Macro
Code:
Copy      Help
ref unrar "unrar"

unrar.RAROpenArchiveData d
;then set d members, call RAROpenArchive, etc
unrar.RAROpenArchive(&d)

The functions are documented in unrardll.txt.
unrar.dll must be in qm folder or in system folder. On 64-bit Windows it is probably c:\windows\syswow64.


Forum Jump:


Users browsing this thread: 1 Guest(s)