AZJIO Posted April 20, 2013 Share Posted April 20, 2013 (edited) I want from the script (au3) call the function from the DLL. The function in the DLL returns an array. Can AutoIt get an array? the only way? $a = DllStructCreate("int[120]") Edited April 20, 2013 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
trancexx Posted April 20, 2013 Share Posted April 20, 2013 Array of what, integers? Do you mean pointer to array of integers? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
AZJIO Posted April 20, 2013 Author Share Posted April 20, 2013 If to be exact, float is necessary. I think to change the size not a problem. My other projects or all Link to comment Share on other sites More sharing options...
trancexx Posted April 20, 2013 Share Posted April 20, 2013 Do you mean exported dll function will return array of floats? You have to be precise about what you want or have. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
JohnOne Posted April 20, 2013 Share Posted April 20, 2013 I've wondered about this. In order for a dll to fill an array passed by autoit, I fear you might need to know the variant type of an autoit array, and moreover that type might have to be supported as a passable value in DllCall. I think Struct pointer might be the only way, and be sure also to pass it's size. 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...
AZJIO Posted April 20, 2013 Author Share Posted April 20, 2013 I think that the array (AutoIt3) is an array of pointers. So will have to use the structure. DLL returns the size of the unknown in advance. I need to get a pointer to a structure? I need to set up data exchange between the script and DLL. My other projects or all Link to comment Share on other sites More sharing options...
JohnOne Posted April 20, 2013 Share Posted April 20, 2013 (edited) Perhaps, but knowing they are pointers is not enough, In C++ you need to know what type of data a pointer points to.And we are full circle.I'm sure you know about DllStructGetPointer and DllStructGetSize. Edited April 20, 2013 by JohnOne 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...
Richard Robertson Posted April 21, 2013 Share Posted April 21, 2013 Since this doesn't seem to be going anywhere fast, I'll speed it up by asking for the dll's function definition. Link to comment Share on other sites More sharing options...
Mat Posted April 30, 2013 Share Posted April 30, 2013 Hopefully something like: int myFunction(int* ret, size_t retLen); We can only hope. AutoIt Project Listing Link to comment Share on other sites More sharing options...
SolUmBao Posted October 20, 2019 Share Posted October 20, 2019 Hi Azjio, I'm working on the same problem how to solve this problem. Principally the problem is the same whether to pass an array with reals or integers or other types. Actually I think about a 'work around' by RAM-Disks. But maybe one of the next Autoit-versions provide a solution, maybe also even with n-dimensional arrays and structs. But there is also another question. If memory was allocated by a function located in a Dll and there was a way to move the result to Autoit, is there a possibility to free this memory from the side of Autoit? Actually I am pretty new in this forum, but I'm extremly interested to work through the possibilities and to overcome some problems. Do you know who would be the right member in the group of developers of Autoit to address questions and ideas? All the best, kind regards! Link to comment Share on other sites More sharing options...
LarsJ Posted October 20, 2019 Share Posted October 20, 2019 The problem and related issues are completely handled and solved by active members. See these threads: Accessing AutoIt Variables .NET, C#, VB.NET:Using .NET libary with AutoIt, possible?.NET Common Language Runtime (CLR) FrameworkDotNet.au3 UDF to access .NET Framework from AutoItUsing C# and VB Code in AutoIt through .NET Framework Accessing arrays:Accessing AutoIt ArraysFast Array Management Functions UDF Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions 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