Hello Tom,
OK, these are the original Strutures and DLL declares.
(from the VB6 Expamle)
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _
Private Structure RARHeaderData
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> _
Public ArcName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> _
Public FileName As String
Public Flags As Integer
Public PackSize As Integer
Public UnpSize As Integer
Public HostOS As Integer
Public FileCRC As Integer
Public FileTime As Integer
Public UnpVer As Integer
Public Method As Integer
Public FileAttr As Integer
Public CmtBuf As String
Public CmtBufSize As Integer
Public CmtSize As Integer
Public CmtState As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)>_
Private Structure RAROpenArchiveData
Public ArcName As String
Public OpenMode As Integer
Public OpenResult As Integer
Public CmtBuf As String
CmtBufSize As Integer
Public CmtSize As Integer
Public CmtState As Integer
End Structure
Private Declare Ansi Function RAROpenArchive Lib "unrar.dll" _
(ByRef ArchiveData As RAROpenArchiveData) As Integer
' using integer, but probably should by System.IntPtr
Private Declare Function RARCloseArchive Lib "unrar.dll" _
(ByVal hArcData As Integer) As Integer
Private Declare Ansi Function RARReadHeader Lib "unrar.dll" _
(ByVal hArcData As Integer, _
ByRef HeaderData As RARHeaderData) As Integer
Private Declare Ansi Function RARProcessFile Lib "unrar.dll" _
(ByVal hArcData As Integer, _
ByVal Operation As Integer, _
ByVal DestPath As String, _
ByVal DestName As String) As Integer
Private Declare Sub RARSetChangeVolProc Lib "unrar.dll" _
(ByVal hArcData As Integer, _
ByVal Mode As Integer)
Private Declare Ansi Sub RARSetPassword Lib "unrar.dll" _
(ByVal hArcData As Integer, ByVal Password As String)
With out looking at the docs, this is what I would do...