Jump to content

Recommended Posts

Posted (edited)

If I create a struct like this

$MonItStruct = DllStructCreate("int;int;char[100];int;char[40];char[40];char[40];char[40];char[40];char[40];char[40];char[40];c

har[40];char[40]")

then I can read the strings from element 5 onwards with memoryread. (Using nomadmemory.au3).

I can set the strings with DllStructSetData($MonItStruct,5,"something",$element)

and read with a memory offset of 112 + ($element - 1)*40 from the address of the start of the struct obtained with DllStructGetPtr($MonItStruct)

I expected that this would be equivalent to

$MonItStruct = DllStructCreate("int;int;char[100];int;char[10][40]")

But when I try to read this with memoryread I only get only the first character for the first string, nothing for the next strings, and DllstructGetData doesn't read the strings back either.

Why aren't the two constructions the same, and what should I have been doing?

Edit:Corrected wrong statement that DllStructGetData could read strings back from array of strings.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...