Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/11/2022 in all areas

  1. To use DllCall() correctly, be aware of the following: The AutoIt DllCall() function can only be used to execute functions in dll-files implemented in unmanaged languages such as C, C++ and Pascal. The DllCall() function cannot be used to execute functions in .NET assembly dll-files implemented in managed languages such as C#, F# or VB.NET. Note that this isn't an AutoIt limitation or a limitation in the DllCall() function. It's a very general limitation when trying to mix any unmanaged programming language with managed code. AutoIt is an unmanaged programming language. Fortunately, there are methods to integrate unmanaged and managed code. This also applies to AutoIt and C# code. With an AutoIt background, the DotNetAll.au3 UDF as implemented in Using C# and VB.NET Code is by far the easiest way to execute C# (or VB.NET) code directly within an AutoIt script. With this technique you have eg. no need for a C# (or VB.NET) IDE, but can handle all code in SciTE. See bottom of this post for a complete list of the benefits of the technique. But this method works best if the C# (or VB.NET) code only depends on internal .NET assembly dll-files or relatively simple external .NET assembly dll-files. In your case it seems to be a slightly more advanced external .NET assembly dll-file. To be sure to get the code working in AutoIt, use the technique briefly demonstrated in this post. This method requires an IDE to compile the C# code into a .NET assembly dll-file and it requires the dll-file to be registered with RegAsm.exe. Why is more C# code needed when a .NET assembly dll file already exists and contains the actual UploadZipFile() method? In your case with the UploadZipFile() method, it is necessary to add a bit more C# code to use the method in AutoIt. The problem is that UploadZipFile() is a static method, and a static method cannot be executed in AutoIt. In the C# code, you must include the .NET assembly dll file and you must write a small wrapper method that works in AutoIt. The wrapper method must be a simple public method as shown in the example in the link and the method must of course call the static UploadZipFile() method. Depending on your experience with AutoIt objects and C# code, getting the code to work isn't necessarily a completely trivial task.
    1 point
  2. Pls. have a look into the help file system, there you will also find an example: https://www.autoitscript.com/autoit3/docs/libfunctions/_FileListToArrayRec.htm
    1 point
  3. Ok. I can see your confusion and I sympathize, at the same time and as you can see above, redundant can be used in a way that is not wholly synonymous with superfluous. To wit, redundant applied to the subject at hand could mean #includes that are repeated; as is not an uncommon usage, for example: Redundant, used in that sense, draws a clear, if subtle distinction with superfluous; for instance an #include that is merely extraneous, as opposed to duplicative. Support for this parochial usage of superfluous in this sense is also extant. If we apply our faculties for discernment fully, we would see that the OP is specifically referring to the use case most precisely defined as superfluous, (although, I do not deny that being superfluous always carries an unshakeable taint of redundancy). Moreover, the usage is not purely pedantic; the logic for a tool designed to root out just duplicative includes instead of extraneous includes could diverge greatly; namely the in the former case one could merely scan #include statements and without further investigation into their contents, be determinative. Penultimately, and by way of an excuse, I would like to note that in my original post, the word superfluous was intentionally emphasized. And as is evident, the language mirrors your statement in my rejoinder, clearly intending to make the distinction between the two adjectives (to which you very astutely were aware of, at least on some level ) Finally, and IMHO, when we are presented with such clues, we should do our best to indulge our conversational partner by striving to look for their intended meaning with an earnest effort; and avoid the temptation of issuing a reflexively puerile response.
    1 point
×
×
  • Create New...