Maybe someone can help me. Since .Net Framework 4.5 there exists an easy to use zip file support in the .net framework. I want to use it in TD so I've used the .net wizard. On GAC I did not found the needed assemblies, so Ive used the option "Assembly File" to search for the system.io.compression classes. It seems that TD then searches the .dll files in the current folder, so I copied the files into the application folder and wrote a function to compress a file into a zip archive.
But the first call it shows an error "Open not found on class System.IO.Compression.ZipFile" on the command "Call __netBase.__Base_InvokeMethod_Overload2('System.IO.Compression.ZipFileExtensions', 'CreateEntryFromFile', payLoad, payLoad )" inside the generated function "System_IO_Compression_ZipFileExtensions_CreateEntryFromFile". The second call works fine, it compresses the file and writes a zip archive. Where is the problem? And can I change my code to get the dll from the .net framework folders without to copy them into my application folder?
- Founder/Site Admin
- Posts: 471
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
The second time executing the code is fine.
Seems to be an initialization issue the first time, but "loads up" eventually so that the second time it works.
Dont know how to solve this, except a workaround to change the code so that there is no error messagebox.
Your code could call it twice then.
As for the GAC. The generated code uses
you can change this to
GAIL_LoadGACAssembly( 'System.IO.Compression.FileSystem.dll' )
Set bGailDisableAutoReportErrors = TRUE
I've got no errors and with
Set ZipArchive = System_IO_Compression_ZipFile_Open( 'test.zip', System_IO_Compression_ZipArchiveMode.Create )
Call ZipArchive.Dispose( )
at first it works. But
Call GAIL_LoadGACAssembly( 'System.IO.Compression.FileSystem.dll')
does not work. I think I should copy the dll files into the application folder and all it from there, but I don't want to get the folder by
Call SalFileGetCurrentDirectory( appDir )
because this folder may have changed by the application. I wold better use strArgArray to get the application folder.
Maybe someone has a better idea why it does not work the first try.
On the first call the function call of "If Not TriggerNetException( )" in function __Base_ReportError of the GailBase.apl crashes with an invalid memory error, removing the call of this function I get no zip file, the second call fails with the same error (method open not found in class).
Has anyone an idea how I can use this famous function within a x64 TD application?
Who is online
Users browsing this forum: Ccbot [Crawler] and 0 guests