Iczer Posted March 28, 2015 Share Posted March 28, 2015 having troubles with unicode in zip.zipfolders UDF i come across DotNetZip - http://dotnetzip.codeplex.com/ it seems have unicode support, but i cannot get to com interface of this library: first: c:\windows\syswow64\regsvr32.exe Ionic.Zip.dll (here a complain about DllRegisterServer) next: #AutoIt3Wrapper_Autoit3Dir=C:\Program Files (x86)\AutoIt3\autoit-v3.3.12.0 ;#AutoIt3Wrapper_Autoit3Dir=C:\Program Files (x86)\AutoIt3\autoit-v3.3.13.20-beta $zip = ObjCreate("Ionic.Zip.ZipFile") MsgBox(64,@error, IsObj($zip)) still no go - @ error = -2147221005 Link to comment Share on other sites More sharing options...
Iczer Posted March 28, 2015 Author Share Posted March 28, 2015 successfully registered library with Regasm.exe Where you once used Regsvr32 on unmanaged COM libraries, you will now use Regasm on managed .NET libraries. “Regsvr32 is the command-line tool that registers .dll files as command components in the registry“ “Regasm.exe, the Assembly Registration tool that comes with the .NET SDK, reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class. The class is registered only once, when the assembly is installed. Instances of classes within the assembly cannot be created from COM until they are actually registered.“ If you want to register an assembly programmatically, see the RegistrationServices class and ComRegisterFunctionAttribute but now @ error = -2147221164... Link to comment Share on other sites More sharing options...
JohnOne Posted March 28, 2015 Share Posted March 28, 2015 Are you going to show how you registered it? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Iczer Posted March 28, 2015 Author Share Posted March 28, 2015 it's simple - in command line : Regasm.exe Ionic.Zip.dll but now i found this code by funkey: and now it's seems to work - object is created... but i need to sleep... Link to comment Share on other sites More sharing options...
Iczer Posted March 29, 2015 Author Share Posted March 29, 2015 So i created some functions i needed - DotNetZip is pretty unicode friendly and well documented many thanks to funkey Global $__DotNetIsLoadedSuccessfully = 0, $DLL_Path_IonicZip = @ScriptDir & "\Ionic.Zip.dll" ;---------------------------------------------------------------------------------------------------------------------------------- ; ;---------------------------------------------------------------------------------------------------------------------------------- Func DotNetZip_ExtractAll($pathToZipFile,$sDestinationDir,$bOverwrite = 1) If Not $__DotNetIsLoadedSuccessfully Then _DotNet_Load($DLL_Path_IonicZip) $oZipFile = ObjCreate("Ionic.Zip.ZipFile") $oZipFile.Initialize($pathToZipFile) $oZipFile.ExtractAll_2($sDestinationDir,$bOverwrite) $oZipFile.Dispose() Return True EndFunc ;---------------------------------------------------------------------------------------------------------------------------------- Func DotNetZip_ListFilesInArc($pathToZipFile) If Not $__DotNetIsLoadedSuccessfully Then _DotNet_Load($DLL_Path_IonicZip) $sEntryList = "" $oZipFile = ObjCreate("Ionic.Zip.ZipFile") $oZipFile.Initialize($pathToZipFile) For $oEntry In $oZipFile $sEntryList &= $oEntry.FileName & "|" Next $oZipFile.Dispose() Return StringSplit(StringTrimRight($sEntryList,1),"|") EndFunc ;---------------------------------------------------------------------------------------------------------------------------------- Func DotNetZip_ExtractSingleFileFromArc($pathToZipFile,$sEntryFileName,$sDestinationDir,$bOverwrite = 1) If Not $__DotNetIsLoadedSuccessfully Then _DotNet_Load($DLL_Path_IonicZip) $oZipFile = ObjCreate("Ionic.Zip.ZipFile") $oZipFile.Initialize($pathToZipFile) $oZipFile.ExtractSelectedEntries_5($sEntryFileName,"",$sDestinationDir,$bOverwrite) $oZipFile.Dispose() Return True EndFunc ;---------------------------------------------------------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now